;---------------------------------------------------------------------- ; This script demonstrates the use of the "cnFillColors" resource for ; changing the colors in a color contour plot. This is a bit of an ; out-dated method, so it is no longer used in the graphics lecture. ; ; In its place, the contour2d_palette.ncl script was added. ;---------------------------------------------------------------------- begin ; ; Note that "t" on this file has no attributes like "long_name" ; or "units". Add units attributes to the coordinate arrays and ; see what happens to plot. ; tf = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") ; Open netCDF file. T = tf->t(0,:,:) ; Read in temperature data. T&lon@units = "degrees_east" T&lat@units = "degrees_north" wks = gsn_open_wks("png","contour1d_levels") gsn_define_colormap(wks,"rainbow") ; Change color map res = True ; Variable to hold plot options res@cnFillOn = True ; Contour fill on res@cnFillColors = (/179,100,69,6,151,31,2,85,165,16,143,80,170,111,15,189/) res@lbOrientation = "Vertical" ; Move labelbar to side res@tiMainString = "res@cnFillColors=(/179,100,...,170,111,15,189/)" plot = gsn_csm_contour(wks,T,res) ; Call the gsn_csm function for ; drawing the contours. end