NCL Website header
NCL Home > Documentation > Graphics > Color Tables > Gallery

Available in version 6.2.0 and later.

When using indexed colors, you can only access the first 254 colors of a 256-color color map. The first two indexes are taken up by the background and foreground colors.

[Color index 0 = white / color index 1 = black]

[Download NCV_rainbow2.rgb file and put in $NCARG_ROOT/lib/ncarg/colormaps, or use NCARG_COLORMAPS.]

Sample NCL script usages:

;---Using the color map to define colors for contours or vectors
  cmap = read_colormap_file("NCV_rainbow2")    ; 256 x 4 float array
  res@cnFillPalette = cmap     ; This assures you use all 256 colors
  res@vcLevelPalette = cmap

;
; Using this to set the color map will only use the
; first 254 colors of a 256-color map
;
  res@cnFillPalette  = "NCV_rainbow2"
  res@vcLevelPalette = "NCV_rainbow2"

;---Using the color map to define a color map for the workstation
  gsn_define_colormap(wks,"NCV_rainbow2")