load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" begin ncolors = 18 ; Plus two colors for background and foreground. hsv_colors = new((/ncolors,3/),float) ; ; White background. ; hsv_colors(0,0) = 0. hsv_colors(0,1) = 0. hsv_colors(0,2) = 1. ; ; Black foreground. ; hsv_colors(1,0) = 0. hsv_colors(1,1) = 0. hsv_colors(1,2) = 0. ; ; Smooth transition from light blue to orange. ; do i=2,ncolors-1 hsv_colors(i,0) = 225.+(i-2)*9.0 ; hues hsv_colors(i,1) = 0.67 ; saturations hsv_colors(i,2) = 1.0 ; values end do cmap = hsvrgb(hsv_colors) wks = gsn_open_wks("x11","example") ; Open an X11 window. gsn_define_colormap(wks,cmap) ; Set the new colormap. lbres = True lbres@lbAutoManage = False lbres@lbFillColors = ispan(0,ncolors-1,1) lbres@lbLabelFontHeightF = 0.02 lbres@lbMonoFillPattern = True lbres@lbOrientation = "Horizontal" lbres@lbPerimOn = False lbres@vpHeightF = 0.40 lbres@vpWidthF = 0.98 lbstrings = ":F26:" + ispan(0,ncolors-1,1) ; Labels for labelbar. gsn_labelbar_ndc(wks,ncolors,lbstrings,0.01,0.98,lbres) ; Draw a ; labelbar. ; ; Title at the bottom. ; textres = True textres@txFontHeightF = 0.03 gsn_text_ndc(wks,":F26:color indices",.5,.64,textres) frame(wks) ; Advance frame. end