x-axis label

From: Xiaoyan Ma <xiaoyan.ma_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 12 2012 - 15:44:28 MDT
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

Received on Thu Apr 12 15:44:44 2012

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