好吧,没人解答,我就自问自答吧,主要问题已基本解决,但是图例的数字没有显示全,求大神解答! 一下照例是代码: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin ;---Read data a = addfile("/home/glozs/gwq/KWRAI.1.SG410.006.cdf","r") x = a->QIELECT*10^9 y = a->QRELECT*10^9 z = a->QGELECT*10^9 i = a->QCELECT*10^9 j = a->QSELECT*10^9
;---Open workstation wks = gsn_open_wks("png","contour1") ; "ps", "pdf", "png"
;---Set some resources res = True
res@gsnMaximize = True ; maximize plot in frame
;---These are sample resources you might want to set res@cnFillOn = True ; turn on contour fill res@cnFillPalette = "nrl_sirkes" ;nrl_sirkes define color map for contours
res@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off line labels res@lbBoxLinesOn = False res@lbOrientation = "Vertical" res@cnConstFLabelFontAspectF="1.0" ; res@gsnSpreadColors = True
;---Uncomment if you want to change the contour levels ; mnmxint = nice_mnmxintvl( min(x), max(x), 18, True) res@cnLevelSelectionMode = "ExplicitLevels" ; res@cnMinLevelValF = -1 ; res@cnMaxLevelValF = 1 ; res@cnLevelSpacingF = 0.01 res@cnLevels =(/-20.0,-10.0,-3.5,-3.0,-2.5,-2.0,-1.5\ ,-1.0,-0.5,-0.1,0.1,0.5,1.0,1.5\ ,2.0,2.5,3.0,3.5,10.0,20.0/)
res@tiMainString = "This is a main title"
contour = gsn_csm_contour(wks,x(:,100,:)+y(:,100,:)+z(:,100,:)+i(:,100,:)+j(:,100,:),res)
end |