# Re: pressure level

Date: Wed Jan 26 2011 - 10:51:35 MST

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.

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

```--
__________________________________________________