Re: problem for "lbLabelStrings"

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 01 2010 - 08:50:05 MDT

Sahidul,

You didn't indicate what happens when you try do create a vertical labelbar.

I tried a sample WRF script with lbOrientation set to "vertical" and it worked, but
it put the labelbar at the bottom of the plot. I had to additionally set
opts@pmLabelBarSide = "Right" to move it to the right.

However, I still had problems with the titles.

The wrf_xxxx scripts are not really set up for a vertical labelbar. I also had to modify these resources,
since they are all internally set by wrf_contour:
 
      opts@pmLabelBarHeightF = 0.7 ; Makes labelbar longer
      opts@pmLabelBarOrthogonalPosF = 0.005 ; Moves labelbar away from plot
      opts@lbTitleOffsetF = 0.0 ; Moves title above plot (wrf_contour sets to a negative value)

You might need to play with these values to get what you want.

--Mary

On Jun 30, 2010, at 11:43 AM, Sahidul wrote:

> Dear NCL help,
>
> I am trying to run a script (shown below), it is working fine. But I am unable to place the label bar "Vertically".
>
> Please help me to sort it.
>
> = = = = = = = = = = = = =
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
>
> datadir = "./wrfout/"
> FILES = systemfunc ("ls -1 " + datadir + "wrfout_d01* " )
> numFILES = dimsizes(FILES)
>
> type = "ps"
>
> res = True
> res@MainTitle = "Eq pot temp Variation"
> pltres = True
> mpres = True
>
> opts = res
> opts@cnFillOn = True
>
> do ifil = 0,numFILES-1
> a = addfile(FILES(ifil)+".nc","r")
>
> ; What times and how many time steps are in the data set?
> times = wrf_user_list_times(a) ; get times in the file
> ntimes = dimsizes(times) ; number of times in the file
>
> ; The specific pressure levels that we want the data interpolated to.
> plevs = (/ 925., 850./) ; pressure levels to plot
> nlevels = dimsizes(plevs) ; number of pressure levels
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> do it = 0,ntimes-1,2 ; TIME LOOP
>
> print("Working on time: " + times(it) )
> res@TimeLabel = times(it) ; Set Valid time to use on plots
>
>
> day = systemfunc("echo "+times(it) +"|cut -c6-7")
> yr = systemfunc("echo "+times(it) +"|cut -c1-4")
> mon = systemfunc("date '+%b'|tr [a-z] [A-Z]")
> hr = systemfunc("echo "+times(it) +"|cut -c12-13")
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> ; First get the variables we will need
>
> T = wrf_user_getvar(a,"tc",it)
> P = wrf_user_getvar(a,"P",it)
> PB = wrf_user_getvar(a,"PB",it)
> qv = wrf_user_getvar(a,"QVAPOR",it)
> T = T + 300.
> P = P + PB
> tk = wrf_tk(P,T)
> eth = wrf_eth(qv,tk,P)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> do level = 0,nlevels-1 ; LOOP OVER LEVELS
>
> pressure = plevs(level)
> p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
> ethp = wrf_user_intrp3d(eth,p,"h",pressure,0.,False)
>
> wks = gsn_open_wks(type,"eth_"+pressure+"hPa"+"_"+day+mon+yr+"_"+hr+"Z")
>
> ; Plotting options for Equivalent pot temp
> opts = res
> opts@cnFillOn = True
> opts@lbOrientation = "vertical"
> opts@lbLabelStrings = (/"275","285","295","305","315","330","345","360","375"/)
>
> contour_ethp = wrf_contour(a,wks,ethp,opts)
> plot = wrf_map_overlays(a,wks,(/contour_ethp/),pltres,mpres)
> if ( pressure .eq. 925 ) then ; plot rh
> plot = wrf_map_overlays(a,wks,contour_ethp,pltres,mpres)
> end if
> if ( pressure .eq. 850 ) then ; plot rh
> plot = wrf_map_overlays(a,wks,contour_ethp,pltres,mpres)
> end if
> end do
> end do
> end do
> end
> = = = = = = = = = = = = =
>
> thanking you,
>
> Sahidul
> _______________________________________________
> 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
Received on Thu Jul 1 08:50:12 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 02 2010 - 07:45:13 MDT