<div dir="ltr">Hi, The other day I tried the improvement, but it didn't work. Here is what I did: <br><br><div><font size="1"> </font><font face="garamond, serif">do it=0,N_times-1</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> u300w = fall[it]->UGRD_P0_L100_GLL0({levs},::-1,:)</font></div><div><font face="garamond, serif"> v300w = fall[it]->VGRD_P0_L100_GLL0({levs},::-1,:)</font></div><div><font face="garamond, serif"> hgt300= fall[it]->HGT_P0_L100_GLL0({levs(k)},:,:)</font></div><div><font face="garamond, serif"> hgt300@units = "m"</font></div><div><font face="garamond, serif"> tmp300 = fall[it]->TMP_P0_L100_GLL0({levs},::-1,:)</font></div><div><font face="garamond, serif"> lat = fall[it]->lat_0(::-1)</font></div><div><font face="garamond, serif"> T300=tmp300({levs(k)},:,:)</font></div><div><font face="garamond, serif"> T300=T300-273.15</font></div><div><font face="garamond, serif"> U300=u300w({levs(k)},:,:)</font></div><div><font face="garamond, serif"> V300=v300w({levs(k)},:,:)</font></div><div><font face="garamond, serif"> wks_type = "png"</font></div><div><font face="garamond, serif"> wks_type@wkWidth = 1700</font></div><div><font face="garamond, serif"> wks_type@wkHeight = 1700</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> mpid = gsn_csm_map(wks,mpres)</font></div><div><font face="garamond, serif"> hnid = gsn_csm_contour(wks,hgt300(:,:),hres)</font></div><div><font face="garamond, serif"> T_300 = gsn_csm_contour(wks,T300,Tres)</font></div><div><font face="garamond, serif"> V_300 =gsn_csm_vector(wks,U300,V300,Vres)</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> ;Overlaps maps in order</font></div><div><font face="garamond, serif"> overlay(mpid,hnid)</font></div><div><font face="garamond, serif"> overlay(mpid,T_300)</font></div><div><font face="garamond, serif"> overlay(mpid,V_300)</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> maximize_output(wks,True)</font></div><div><font face="garamond, serif"> ;el comando maximize_output hace lo que hacia frame</font></div><div><font face="garamond, serif"> <span style="background-color:rgb(255,255,0)"> delete(wks)</span></font></div><div><font face="garamond, serif"> <span style="background-color:rgb(255,255,0)">cmd="convert -trim "+ "animate"+sprinti("%03i",it)+".png" "animate"+sprinti("%03i",it)+".png"</span></font></div><div> system(cmd)</div><div> end do<br><br><br>It's throwing me error when I tried to use the convert command. I was able to use it without problems for one file, but not yet inside a loop.<br><br><br>Any help would be really helpful,<br><br>All the best,<br>Sebastián.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 8, 2015 at 11:43 AM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hi <span style="background-color:rgba(255,255,255,0)">Sebastián,</span></div><div>You need to delete the workstation before you call convert otherwise you will get an error message:</div><div><br></div><div>do it=0,1</div><span class=""><div><span style="background-color:rgba(255,255,255,0)"> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))</span></div></span><div>..........</div><div> plot = ..........</div><div><span style="background-color:rgba(255,255,255,0)"> delete(wks)</span></div><div><span class=""><span style="background-color:rgba(255,255,255,0)"> system("convert -trim"animate"+sprinti("%03i",it)+".png" "animate"+sprinti("%03i",it)+".png")</span><br></span>end do</div><div><br></div><div>Hope that helps.. If not let ncl-talk know.</div><span class="HOEnZb"><font color="#888888"><div>Adam</div></font></span><div><div class="h5"><div><br>On Aug 8, 2015, at 6:58 AM, Sebastian Otarola-Bustos <<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu" target="_blank">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Thank you very much, that was really helpful! I think that my trouble is solved. By the way, and only for curiosity, you know if you can use the trim option inside a loop, to get a gif with all images without those blank spaces. Cause I tried something like this inside a loop, but it didn't work: <br><br> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br><br> system("convert -trim"animate"+sprinti("%03i",it)+".png" "animate"+sprinti("%03i",it)+".png")<br><br><br>All the best,<br><br>Thank you a lot.<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 2:42 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">I didn't notice this before, but you can't use the wkWidth and wkHeight resources with PS or PDF. These width and height are for pixel sizes, which apply to the X11 and PNG workstations only.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you want an image to be a specific pixel size, then you need to use "PNG" as the output. With PNG as the output, the image will not be rotated automatically, so you don't need to set gsnPaperOrientation.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, NCL always draws its images to a square, so your image is going to be the smaller of the two sizes you specified: 1536 x 1536.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My suggestion is to set the size to 1700 x 1700, and then use <a href="http://www.imagemagick.org/script/index.php" target="_blank">ImageMagick</a>'s "convert" to trim the image. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've attached a sample script.</div><span><font color="#888888"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 1:46 PM, Sebastian Otarola-Bustos <span dir="ltr"><<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu" target="_blank">Sebastian.F.Otarola-Bustos.1@nd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, <br><br>Thank you very much, but it seems that doesn't works. The plot it's too big I think.<br><br><br>All the best,<br>Sebastián.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 11:19 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Try setting gsnPaperOrientation with the "mpres" resources and not the workstation resources.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I know this doesn't make a lot of sense, but it's when the plot is being created that it needs to know that the paper is oriented one way or another.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Aug 4, 2015 at 12:34 AM, Sebastian Otarola-Bustos <span dir="ltr"><<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu" target="_blank">Sebastian.F.Otarola-Bustos.1@nd.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi All, I was doing a gif animation in .png format, and I was able to set the width and the height, so my plots were ok. But now I'm trying to do the same with .ps format or .pdf, and I'm having some troubles. It's rotated, and the command, wks_type@gsnPaperOrientation = "portrait" is not recognized. Any suggestion? <br>Any help would be really appreciated, below you can see what I mentioned to you from my code.<br><br><div> <font face="garamond, serif">wks_type = "ps"</font></div><div><font face="garamond, serif"> ;wks_type@wkWidth = 1700</font></div><div><font face="garamond, serif"> ;wks_type@wkHeight = 1536</font></div><div><font face="garamond, serif"> wks_type@gsnPaperOrientation = "portrait"</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> mpid = gsn_csm_map(wks,mpres)</font></div><div><font face="garamond, serif"> hnid = gsn_csm_contour(wks,hgt300(:,:),hres)</font></div><div><font face="garamond, serif"> T_300 = gsn_csm_contour(wks,T300,Tres)</font></div><div><font face="garamond, serif"> V_300 =gsn_csm_vector(wks,U300,V300,Vres)</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif"> ;Overlaps maps in order</font></div><div><font face="garamond, serif"> overlay(mpid,hnid)</font></div><div><font face="garamond, serif"> overlay(mpid,T_300)</font></div><div><br>All the best, <br>Sebastián.</div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>ncl-talk mailing list</span><br><span><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a></span><br><span>List instructions, subscriber options, unsubscribe:</span><br><span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></span><br></div></blockquote></div></div></div></blockquote></div><br></div>