; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin data = generate_2d_array(17, 15, 0, 50, 0, (/50,50/)) wks = gsn_open_wks("png","highlight_contours") levels = ispan(1,42,2) nlevels = dimsizes(levels) res = True res@gsnMaximize = True ; Maximize plot in frame res@vpWidthF = 0.8 res@vpHeightF = 0.5 res@cnFillOn = True res@cnLinesOn = False res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = levels res@tiMainString = "default colors" plot_orig = gsn_csm_contour(wks,data,res) ;---Read in color map as an RGBA array rgba = span_color_rgba("ncl_default",nlevels+1) ;--Set last 11 colors to be more transparent rgba(nlevels-11:,3) = 0.25 ;--Create a new plot with the modified color map res@cnFillPalette = rgba res@tiMainString = "Make last few colors more transparent" plot_trans = gsn_csm_contour(wks,data,res) ;---Panel both plots for comparison gsn_panel(wks,(/plot_orig,plot_trans/),(/2,1/),False) end