;************************************************* ; NCL Graphics: panel_7.ncl ;************************************************ 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/shea_util.ncl" ;************************************************ begin ;************************************************ ; read in netCDF file ;************************************************ a = addfile("uv300.nc","r") ;************************************************ ; read in zonal winds ;************************************************ u = a->U(1,:,:) ; read July zonal winds ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("ps" ,"panel") ; open a ps file res = True ; plot mods desired res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels res@cnMinLevelValF = -10. ; set min contour level res@cnMaxLevelValF = 35. ; set max contour level res@cnLevelSpacingF = 5. ; set contour spacing res@cnInfoLabelOrthogonalPosF = -0.07 ; move contour label up res@tmXBLabelsOn = False ; do not draw bottom labels res@tmXBOn = False ; no bottom tickmarks res@gsnDraw = False ; Do not draw plot res@gsnFrame = False ; Do not advance frame plot = new(3,graphic) ; create graphics array ;********************************************************************** ; Note that ShadeLtGtContour, ShadeLtContour, and ShadeGtContour ; all use greater (less) than, and NOT greater (less) than or equal to. ; These functions will find the closest CONTOUR less than ; the specified threshold value when choosing when to start shading. For ; instance, for plot(0) below, ShadeLtGtContour(plot(0),0., 3,31.9.,17) ; will result in all areas -5. or less being shaded shade pattern 3, and ; all areas 30. or greater being shaded shade pattern 17. -5. is the ; closest contour less than 0, and 30. is the closest contour greater than ; 31.9. ; ; Note: As of ncl version 4.3.0, ShadeLtGtContour, ShadeLtContour, and ; ShadeGtContour have been superceded by the more versatile gsn_contour_shade. ;*********************************************************************** plot(0) = gsn_csm_contour_map_ce(wks,u, res) ; create plot object plot(0) = ShadeLtGtContour(plot(0),0., 3,31.9.,17) ; shade cons <0 and >30 plot(1) = gsn_csm_contour_map_ce(wks,u, res) ; create plot object plot(1) = ShadeLtContour(plot(1), 0.1, 3) ; shade contours < 0. delete(res@tmXBLabelsOn) delete(res@tmXBOn) plot(2) = gsn_csm_contour_map_ce(wks,u, res) ; create plot object plot(2) = ShadeGtContour(plot(2),30.1,17) ; shade contours > 30. ;******************************************* ; draw panel plot with title ;******************************************* pres = True ; mod panel plot pres@gsnPanelBottom = 0.05 ; add some space at bottom pres@txString = "Example of Compressed Panel Plot" gsn_panel(wks,plot,(/3,1/),pres) ; create panel plot end