Re: x-axis label

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 12 2012 - 16:09:53 MDT

Hello,
See the two examples here:
http://www.ncl.ucar.edu/Applications/time_labels.shtml
and see examples 2+4 (amongst others) here:
http://www.ncl.ucar.edu/Applications/tickmarks.shtml

you need to set res@tmXBMode = "Explicit", along with tmXBValues and
tmXBLabels..
Hope that helps..
Adam

On 04/12/2012 03:44 PM, Xiaoyan Ma wrote:
> Hi all,
>
> I read a variable from a cdf file, and then create a plot as attached.
> The x and y axis are the defaulted values.
> Now I want to show hours on x-axis, rather than seconds by default.
> can anyone tell me how to make it?
> Below is my ncl script. Thanks,
>
> ;*************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ;*************************************************
> begin
>
> wks = gsn_open_wks("ps", "ext")
> gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
> f = addfile("sgp10rlprofbe1newsC1.s1.20080601.cdf","r")
> printVarSummary(f->ext)
> var0 = f->ext ; (time,height)
> var= var0(height|:,time|:)
> printVarSummary(var)
> res = True
> res@cnFillOn = True ; turn on color fill
> res@cnLinesOn = False ; turn of contour lines
> res@gsnSpreadColors = True ; use full range of color map
> res@lbOrientation = "vertical" ; vertical label bar
> res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels
> res@gsnAddCyclic = False ; data already has cyclic point
> res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour
> levels
> res@cnLevels =
> (/0.02,0.03,0.04,0.05,0.06,0.08,0.1,0.2,0.3,0.4/)
>
> plot = gsn_csm_contour(wks, var, res )
>
> end
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
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-talk
Received on Thu Apr 12 16:10:03 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 13 2012 - 13:37:52 MDT