<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi&nbsp;<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><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; &nbsp; wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))</span></div><div>..........</div><div>&nbsp; &nbsp; plot = ..........</div><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; &nbsp; delete(wks)</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; &nbsp; system("convert -trim"animate"+sprinti("%03i",it)+".png" "animate"+sprinti("%03i",it)+".png")</span><br>end do</div><div><br></div><div>Hope that helps.. If not let ncl-talk know.</div><div>Adam</div><div><br>On Aug 8, 2015, at 6:58 AM, Sebastian Otarola-Bustos &lt;<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>&gt; 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 &nbsp;something like this inside a loop, but it didn't work:&nbsp;<br><br>&nbsp;wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br><br>&nbsp;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">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</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.&nbsp; 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. &nbsp;</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 class="HOEnZb"><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 class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 1:46 PM, Sebastian Otarola-Bustos <span dir="ltr">&lt;<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu" target="_blank">Sebastian.F.Otarola-Bustos.1@nd.edu</a>&gt;</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,&nbsp;<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">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</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">&lt;<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu" target="_blank">Sebastian.F.Otarola-Bustos.1@nd.edu</a>&gt;</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 &nbsp;= "portrait" &nbsp;is not recognized. Any suggestion?&nbsp;<br>Any help would be really appreciated, below &nbsp;you can see what I mentioned to you from my code.<br><br><div>&nbsp;<font face="garamond, serif">wks_type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= "ps"</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; ;wks_type@wkWidth &nbsp; &nbsp;= 1700</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; ;wks_type@wkHeight &nbsp; = 1536</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wks_type@gsnPaperOrientation &nbsp;= "portrait"</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mpid &nbsp; &nbsp;= gsn_csm_map(wks,mpres)</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hnid &nbsp;= &nbsp;gsn_csm_contour(wks,hgt300(:,:),hres)</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T_300 &nbsp;= gsn_csm_contour(wks,T300,Tres)</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;V_300 &nbsp; =gsn_csm_vector(wks,U300,V300,Vres)</font></div><div><font face="garamond, serif"><br></font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;Overlaps maps in order</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;overlay(mpid,hnid)</font></div><div><font face="garamond, serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;overlay(mpid,T_300)</font></div><div><br>All the best,&nbsp;<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">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">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></span><br></div></blockquote></body></html>