Re: Legend problem

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 06 2010 - 13:14:33 MST

Please look at the legend examples ......

See: http://www.ncl.ucar.edu/Applications/legend.shtml

Example 10

On 01/06/2010 12:43 PM, Li, Yongzuo wrote:
> Hi,
>
> I have problem to put legend at desired location. The script is like
>
> ; legend resources
> res@pmLegendDisplayMode = "Always"
> res@pmLegendSide = "Bottom"
> res@pmLegendZone = 0.
> res@pmLegendOrthogonalPosF = .01
> res@lgJustification = "BottomRight"
> res@pmLegendWidthF = 0.15
> res@pmLegendHeightF = 0.20
> res@lgPerimOn = False
> res@xyExplicitLegendLabels = (/"Best track", "Hybrid","pureGFS","3DVAR"/)
> res@lgLabelFontHeightF = 0.02
> plot = gsn_xy(wks,x,y,res) ; create plot
>
> My plot is the link
> ftp://ftp.caps.ou.edu/users/yli/ike-minslp.pdf
>
> I just want to put legend at lower-right corner.
>
> Thanks.
>
> Yongzuo
> ________________________________________
> From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on behalf
> of ncl-talk-request@ucar.edu [ncl-talk-request@ucar.edu]
> Sent: Wednesday, January 06, 2010 1:00 PM
> To: ncl-talk@ucar.edu
> Subject: ncl-talk Digest, Vol 74, Issue 13
>
> Send ncl-talk mailing list submissions to
> ncl-talk@ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. Re: Making pressure-height plot with equally spaced pressure
> level (Mary Haley)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 6 Jan 2010 10:28:56 -0700
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Making pressure-height plot with equally
> spaced pressure level
> To: Jeff <jeffelf@gmail.com>
> Cc: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <A13754AF-7655-4214-A804-B01A4C9C92BF@ucar.edu>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Yaosheng,
>
> I didn't see your attachment, but I think I know what the solution
> might be.
>
> The problem you are referring to is illustrated in example #1 on our
> "axes" applications page:
>
> http://www.ncl.ucar.edu/Applications/axes.shtml
>
> Click on both thumbnail images, and you will see how the Y axis changes.
>
> If you simply want to linearize the Y axis, then use gsn_csm_contour
> as before,
> but additionally set the resource:
>
> res@gsnYAxisIrregular2Linear = True
>
> --Mary
>
>
> On Jan 5, 2010, at 9:33 PM, Jeff wrote:
>
> > Hi, Mary,
> >
> > Thanks for reply. I tried your method but the result is not what I
> > need.
> >
> > When you use gsn_csm_pres_hgt to make plots of zonal mean of a
> > variable in a 3D data, it does not matter which pressure levels the
> > data include.
> >
> > For example, if data1 contains 6 equally spaced levels on 1000, 800,
> > 600, 400, 200, 0 mb and data2 contains 6 levels on 1000, 990, 950,
> > 900, 700, 400, 0 mb, the axis in final plots will look the same. I
> > mean, the right axis of height is always equally spaced. So it is like
> > there is a pre-setup frame, and data are put into the frame.
> >
> > However, using gsn_csm_contour, each level will occupy a row of same
> > width in the figure. Use the 6 levels example I mentioned above, the
> > distance between 1000 and 900 will be same as that between 900 and 0
> > mb.
> >
> > Enclosed is a figure from gsn_csm_contour. The space between 800 and
> > 600 in Y axis is larger than that between 600 and 400, because I have
> > more model layers (or more rows of data in the 2d variable I'm going
> > to plot) between 800 and 600 than between 600 and 400. But what I want
> > is equally spaced Y axis.
> >
> > Although it may work, I don't want to interpolate the data to equally
> > spaced pressure levels since it may introduce some error.
> >
> > Looking forward to your help. Thank you very much.
> > Yaosheng
> >
> > On Tue, Jan 5, 2010 at 11:47 AM, Mary Haley <haley@ucar.edu> wrote:
> >>
> >> You are on the right track with the idea of setting up
> >> coordinates. You can
> >> use the coordinate array feature if your coordinates are 1D.
> >>
> >> That is, you must have a 1D array of altitude values that has the
> >> same
> >> number of points as the leftmost dimension of your data array, and
> >> a 1D
> >> array of latitude values that has the same number of points as the
> >> rightmost
> >> dimension of your data array.
> >>
> >> If your data array is called "X", your altitude values "ALT", your
> >> latitude
> >> values "LAT", then you can set up the metadata for "X" so that you
> >> can plot
> >> it using gsn_csm_contour:
> >>
> >>
> >> X!0 = "alt" ; Name X's dimensions
> >> X!1 = "lat"
> >> X&alt = ALT ; Using the names we just created,
> >> X&lat = LAT ; attach the coordinate arrays to X
> >>
> >> Now, if you plot X:
> >>
> >> plot = gsn_csm_contour(wks,X,res)
> >>
> >> it will see the coordinate arrays attached to X, and you should
> >> have the
> >> correct values on your X and Y axis.
> >>
> >> --Mary
> >>
> >> On Jan 4, 2010, at 10:34 AM, Jeff wrote:
> >>
> >>> Hi, Sir/Madam,
> >>>
> >>> I would like to make plots of zonal mean of some variable, that
> >>> is, a
> >>> plot with altitude as Y-axis versus latitude as X-axis.
> >>> However, all examples I found on NCL website using equally spaced
> >>> height as Y-axis.
> >>> How can I use equally spaced pressure or sigma level as Y-axis?
> >>>
> >>> I also checked examples for general contour plots. They may serve
> >>> well. However, the example is too simple for me to follow. I have no
> >>> idea about how should I setup coordinates for the variable to
> >>> plot so
> >>> that NCL can understand Y-axis is altitude and X-axis is latitude or
> >>> whatever coordinate. Is there a detailed example?
> >>>
> >>> Thank you very much.
> >>> Yaosheng Chen
> >>> _______________________________________________
> >>> ncl-talk mailing list
> >>> List instructions, subscriber options, unsubscribe:
> >>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
> >>
> > _______________________________________________
> > ncl-talk mailing list
> > 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/20100106/7f236750/attachment.html
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 74, Issue 13
> ****************************************
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate&  Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 6 13:16:08 2010

This archive was generated by hypermail 2.1.8 : Wed Jan 06 2010 - 17:07:09 MST