;************************************************* ; color_14.ncl ; ; Concepts illustrated: ; - Drawing grayscale filled contours ; - Selecting a grayscale color map ; - Setting a black background/white foreground ; ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;************************************************ begin ;************************************************ ; read in netCDF file ;************************************************ a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r") u = a->U(1,:,:) ; read July zonal winds ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("ps","color") ; open a ps file gsn_define_colormap(wks,"gsltod") ; choose colormap res = True ; plot mods desired res@cnFillOn = True ; turn on color fill ;---This resource not needed in NCL V6.1.0 res@gsnSpreadColors = True ; use full range of colormap plot = gsn_csm_contour_map_ce(wks,u, res) ; create plot ; reverse the first two colors setvalues wks "wkColorMap" : "gsltod" "wkForegroundColor" : (/0.,0.,0./) "wkBackgroundColor" : (/1.,1.,1./) end setvalues plot = gsn_csm_contour_map_ce(wks,u, res) ; create plot end