A question about resource tmXBMode

From: Zheng Lu <cfluzheng_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 09 2012 - 21:19:30 MDT

Hi, all,

I have a question about resources of tmXBMode and tmYLMode. I tried to plot
the contour of a 31*32 array using gsn_csm_contour with explicit tick mark
mode. However, the figure looks wrong. First, the X-axis and Y-axis labels
do not show. Also the location of colorbar is not right also. Could someone
help me with this question? Thanks much!

Zheng

P.S. The code:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

;*********************************
begin
;*********************************

ss=asciiread("ss.txt",(/31,32/),"float")

wks = gsn_open_wks("x11","stat") ; open a ncgm file
  gsn_define_colormap(wks,"precip_diff_12lev") ; choose a colormap

  res = True ; plot mods desired
  res@cnFillMode = "RasterFill"
  res@cnFillOn = True ; turn on color
 res@cnLinesOn = False

 res@gsnDraw =False
   res@gsnFrame=False

plevel=(/-90,-60,-40,-30,-20,-10,10,20,30,40,60,90/)
pcolor= (/2,3,4,5,6,7,8,9,10,11,12,13,14 /)
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = plevel
res@cnFillColors = pcolor

res@tmXBMode="Explicit"

res@tmXBValues=(/0,5,10,15.5,21,26,31/)
res@tmXBLables=(/"-1.5","-1.0","-0.5","0","0.5","1.0","1.5"/)
res@tmXBLabelFontHeightF=0.01

res@tmYLMode="Explicit"
res@tmYLValues=(/0,5,10,15,20,25,30/)
res@tmYLLables=(/"0","1","2","3","4","5","6"/)
res@tmYLLabelFontHeightF=0.01

  res@vpWidthF = 0.5
  res@vpHeightF = 0.3

  plot = gsn_csm_contour(wks,ss,res)
res_lines=True

xx=(/15.5,15.5/)
yy=(/0,30/)

line = gsn_add_polyline(wks,plot,xx,yy,res_lines)
draw(plot)
frame(wks)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 9 21:19:40 2012

This archive was generated by hypermail 2.1.8 : Fri Oct 12 2012 - 15:38:19 MDT