Re: How to avoid being truncated and the position of legend?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 13 Feb 2007 14:01:33 -0700 (MST)

Another thing you can try, if you are using a gsn_xxx type of routine
and using "pmLegendDisplayMode" to turn on the legend, and that is to
set res_at_gsnMaximize = True. This resource will internally cause NCL to
take a look at your plot, and resize it to fit whatever output device
(X11 window, PS file, etc) you are using. If the plot is too big for
the output device, NCL will then make the plot smaller so that it will
fit.

However, if you are drawing the legend yourself, or adding other
things to the plot later (like text strings), then Adam's suggestion
is the one to use.

--Mary

On Tue, 13 Feb 2007, Adam Phillips wrote:

> Hi Xiaoming,
>
> In the future please include your script or your resource list when asking
> questions about NCL graphics. It makes it easier for us to diagnose the
> problem...
>
> Anyway, in this case, your labels/legend are being drawn partially outside
> the viewport. You can set the viewport resources to position where the plot
> appears in the viewport. You set the viewport resources in NDC units, which
> range from 0->1:
>
> res_at_vpXF = 0.2 ; where left side of plot starts
> res_at_vpWidthF = 0.6 ; starting from vpXF, continue on 0.6 NDC units
> ; Plot will run from 0.2 to 0.8 NDC units
> ; in the x-direction
> res_at_vpYF = 0.8 ; where top of plot starts
> res_at_vpHeightF = 0.6 ; starting from vpYF, continue on 0.6 NDC units
> ; Plot will run from 0.8->0.2 NDC units in the
> ; y-direction
>
> The above settings will center your plot on the page, and should leave room
> for the tiYAxisString and legend. Note that vpXF and vpYF set where the plot
> border starts, and not where the tickmark labels or axis labels start.
>
> You can set the relative position of the legend using pmLegendSide as you are
> doing, but you can further move the legend any way you wish by using the
> pmLegendOrthogonalPosD and pmLegendParallelPosF resources:
>
> http://www.ncl.ucar.edu/Document/Graphics/Resources/pm.shtml#pmLegendSide
> http://www.ncl.ucar.edu/Document/Graphics/Resources/pm.shtml#pmLegendOrthogonalPosF
> http://www.ncl.ucar.edu/Document/Graphics/Resources/pm.shtml#pmLegendParallelPosF
>
> Good luck,
> Adam
>
> Xiaoming Hu wrote:
>> Dear all
>>
>> I attached the figure made by me.
>>
>> You may notice that the legend is truncated
>>
>> Also the tiYAxisString is also truncated since I have the resource as
>> below:
>> res_at_tiYAxisString ="rate coefficient, cm:S:3:N:molec.:S:-1:N:s:S:-1"
>>
>> How to avoid this?
>>
>> Also about the position of the legend, do we have more choices other than
>> top, bottom,right and left? In matlab we have others like upright conner,
>> something like that, which is convenient.
>>
>> Thanks very much
>>
>> Xiaoming
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000 Boulder, CO 80307-3000
> http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 13 2007 - 14:01:33 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 14:07:37 MST