[ncl-talk] Vertical Cross Section Axes Labels question
Adam Phillips
asphilli at ucar.edu
Thu Mar 8 15:50:37 MST 2018
Hi Barry,
When setting the tmYLValues resource, one needs to make sure that the
values input into tmYLValues match up with the range of the coordinate
variable data associated with the first dimension of the array input into
the gsn plotting function. In this case, you are setting this:
opts_xy at tmYLMode = "Explicit"
opts_xy at tmYLValues = fspan(0,zspan,nz) ;
Create tick marks
opts_xy at tmYLLabels := sprintf("%.1f",fspan(zmin,zmax,nz)) ;
Create labels
and creating a plot like this:
plot_rad1(0) = gsn_csm_contour(wks,dbz,opts_rad)
In this case, dbz does not have any coordinate variable associated with the
first dimension. Thus, NCL under-the-hood assigns it an array equal to
ispan(0,8,1) (as the first dimension of dbz is of size 9). Your tmYLValues
range from 0 to 100 by 10. Thus, NCL only has data that goes as high as 8
but you are assigning tickmark labels every 10, and NCL will only plot the
range of data it has (unless you overrule it by setting trYMaxF = 100 for
instance).
Your second question is semi-related to the first. You can set the
tmXBValues/tmXBLabels much as how you set the tmYL resources, but again you
need to make sure that your tmXBValues are within the range of the
coordinate variable associated with the 2nd dimension of the array input
into the NCL plotting function.
In this case, you again do not have any coordinate variable associated with
the 2nd dimension of dbz, so NCL assigns an array of ispan(0,100,1). Thus,
the values in tmXBValues much be within that range. Finally, there are
numerous ways to set the tickmarks. See examples here:
http://www.ncl.ucar.edu/Applications/time_labels.shtml
and here:
http://www.ncl.ucar.edu/Applications/tickmarks.shtml
Hope that helps.
Adam
On Wed, Mar 7, 2018 at 11:02 AM, Barry Lynn <barry.h.lynn at gmail.com> wrote:
> Hello:
>
> I am plotting qvp diagrams.
>
> To run this program, you need to use the *tar file and the ncl file.
>
> The y or z axis is height and the x-axis should be time.
>
> I have a couple of questions.
>
> 1) I see that the label
>
> opts_xy at tmYLLabels0.0
> is defined for all values from 0 to 5, but it does not appear on the y
> axis.
>
> 2) I am wondering how I can convert the times (from time_var) in the
> variable Times to something I could put on the x-axis, and how I would get
> these times to appear as well.
>
> Thank you for help in solving these two problems.
>
> Barry
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108 <(914)%20432-3108>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180308/7dd6e2ca/attachment.html>
More information about the ncl-talk
mailing list