[ncl-talk] PDF plot to big and rotated in 90 degrees.

Mary Haley haley at ucar.edu
Thu Aug 6 12:42:38 MDT 2015


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.

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.

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.

My suggestion is to set the size to 1700 x 1700, and then use ImageMagick
<http://www.imagemagick.org/script/index.php>'s "convert" to trim the
image.

I've attached a sample script.

--Mary



On Wed, Aug 5, 2015 at 1:46 PM, Sebastian Otarola-Bustos <
Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:

> Hi,
>
> Thank you very much, but it seems that doesn't works. The plot it's too
> big I think.
>
>
> All the best,
> Sebastián.
>
> On Wed, Aug 5, 2015 at 11:19 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> Try setting gsnPaperOrientation with the "mpres" resources and not the
>> workstation resources.
>>
>> 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.
>>
>> --Mary
>>
>>
>> On Tue, Aug 4, 2015 at 12:34 AM, Sebastian Otarola-Bustos <
>> Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:
>>
>>> 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 at gsnPaperOrientation  = "portrait"
>>>  is not recognized. Any suggestion?
>>> Any help would be really appreciated, below  you can see what I
>>> mentioned to you from my code.
>>>
>>>  wks_type            = "ps"
>>>         ;wks_type at wkWidth    = 1700
>>>         ;wks_type at wkHeight   = 1536
>>>          wks_type at gsnPaperOrientation  = "portrait"
>>>
>>>          wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))
>>>
>>>          mpid    = gsn_csm_map(wks,mpres)
>>>          hnid  =  gsn_csm_contour(wks,hgt300(:,:),hres)
>>>          T_300  = gsn_csm_contour(wks,T300,Tres)
>>>          V_300   =gsn_csm_vector(wks,U300,V300,Vres)
>>>
>>>          ;Overlaps maps in order
>>>          overlay(mpid,hnid)
>>>          overlay(mpid,T_300)
>>>
>>> All the best,
>>> Sebastián.
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150806/b72d816f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: png_example.ncl
Type: application/octet-stream
Size: 1102 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150806/b72d816f/attachment.obj 


More information about the ncl-talk mailing list