Hi Wei,
The normal way to restrict the range of the Y-axis is to use the trYMinF
and trYMaxF resources:
http://www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trYMinF
I see in the snippet of code you sent you had this:
opts_xy@tmYLValues = fspan(0,100,10)
opts_xy@tmYLLabels = fspan(1000,100,10)
Your tmYLValues will thus equal the following:
(0) 0
(1) 11.11111
(2) 22.22222
(3) 33.33333
(4) 44.44444
(5) 55.55555
(6) 66.66666
(7) 77.77777
(8) 88.88889
(9) 100
and will be labeled 1000,900,800,700,etc
If this is what you want, then you will want to set
opts_xy@trYMinF = 77.7777 as that corresponds to your 300hPa label.
Hope that helps. If not, let the group know.
Adam
On 01/26/2011 10:08 AM, wei huang wrote:
> Dear NCL users,
>
> I want to plot a pressure level along y-axis from 1000(bottom) to
> 300(top), but when I used the loop(given below), it is created from 1000
> t0 200. Could anyone give me some help how to do it?
>
> thanks
>
> wei
>
> -------
>
> -------
>
> ; Create labels
>
> if (FirstTime) then
>
> zz = z/100.
>
> dims = dimsizes(zz)
>
> zmax = -999.
>
> do imax = 1,dims(0)-1
>
> if ( .not.ismissing(zz(imax,1,1)) .and. zz(imax,1,1) .gt. zmax ) then
>
> zmax = zz(imax,1,1)
>
> end if
>
> end do
>
> imax = floattoint(zmax)
>
> zmax = imax/10.
>
> print("Y labels set to: 0 - " + zmax + " km")
>
> FirstTime = False
>
> end if
>
> -------
>
> -------
>
> ;Options for XY Plots
>
> opts_xy= res
>
> opts_xy@tiYAxisString= "Pressure (hPa)"
>
> opts_xy@AspectRatio= 0.75
>
> opts_xy@tmYLMode= "Explicit"
>
> opts_xy@tmYLValues = fspan(0,100,10) ; over the 0-100 span of the Y label
>
> opts_xy@tmYLLabels= fspan(1000,100,10); Corresponding 11 labels
>
> ;
>
> Variable: pv
>
> Type: float
>
> Total Size: 4106700 bytes
>
> 1026675 values
>
> Number of Dimensions: 3
>
> Dimensions and sizes:[bottom_top | 39] x [south_north | 195] x
> [west_east | 135]
>
> Coordinates:
>
> Number Of Attributes: 6
>
> description : Potential Vorticity
>
> units :
>
> FieldType :104
>
> MemoryOrder : XYZ
>
> stagger :
>
> coordinates : XLONG XLAT
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- __________________________________________________ Adam Phillips asphilli@ucar.edu National Center for Atmospheric Research tel: (303) 497-1726 Climate and Global Dynamics Division fax: (303) 497-1333 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Wed Jan 26 10:51:41 2011
This archive was generated by hypermail 2.1.8 : Mon Jan 31 2011 - 10:38:24 MST