load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ; ; Create dummy data z to have bands of values: ; 0,10,20,...,360,0,10, ...,360,5,10,20,... ; nz = 78 i = (ispan(0,nz-1,1)%37) * 10. ; ; The "ind" line will cause our values to be 5,10,20,...,360,5,10,... ; ; i(ind(i.eq.0)) = 5 ; At value 0, set to 5. ; z = new((/nz,nz/),float) z = conform(z,i,0) ; ; Separate the values of z into two new arrays such that neither ; of the new arrays will contain both the original min and max ; of z, but that there is some overlap in values. ; zmin = min(z) zmax = max(z) third = (zmax-zmin)/3. mid1 = zmin + third mid2 = zmax - third z1d = ndtooned(z) z1d(ind(z1d.eq.max(z))) = -1 ; Get rid of max value. newz = onedtond(z1d,dimsizes(z)) z2 = mask(z,mid1.lt.z.and.z.le.zmax,True) ; Top 2/3 of values z3 = mask(newz,newz.le.mid2,True) ; Bottom 2/3 of values ; ; Begin graphics. ; wks = gsn_open_wks("ps","phase") gsn_define_colormap(wks,"rainbow") res = True res@gsnMaximize = True res@gsnSpreadColors = True res@cnLinesOn = False res@cnFillOn = True res@lbLabelAutoStride = True res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = ispan(2,360,10) ; ; Draw the original just to see what it looks like. ; res@tiMainString = "Full data plotted" plot = gsn_csm_contour(wks,z,res) ; ; Create and draw the two incomplete plots, individually. ; res@gsnDraw = False res@gsnFrame = False res@tiMainString = "Top 2/3 data plotted" plot1 = gsn_csm_contour(wks,z2,res) res@tiMainString = "Bottom 2/3 data plotted" plot2 = gsn_csm_contour(wks,z3,res) ; ; Now draw the two "incomplete" plots, which together, should ; make a complete plot. ; setvalues plot1 "tiMainOn" : False end setvalues setvalues plot2 "tiMainString" : "Bottom and top 2/3 data plotted" end setvalues draw(plot1) draw(plot2) frame(wks) end