[ncl-talk] how to invert the color table?

Dennis Shea shea at ucar.edu
Tue Oct 27 12:28:58 MDT 2015


DId you look at any of the color examples:

http://www.ncl.ucar.edu/Applications/
Click "Color Fill"

===

"To reverse or subset a predefined color map, use the function

read_colormap_file to read the file in as an RGBA array (n x 4). You
can then subset or reverse it using normal NCL array subscripting:

  cmap = read_colormap_file("BlGrYeOrReVi200")
  res at cnFillPalette = cmap(::-1,:)     ; reverse color map

  res at cnFillPalette = cmap(10:100,:)   ; subset color map

===

Good luck

On Tue, Oct 27, 2015 at 11:14 AM, Jesús Garcia Rosales
<jesus21gr at gmail.com> wrote:
> Hello ncl users,
> I would like to know how to invert the color table, because all the values
> that I present are negative. The problem is that I would like the value 0
> will be white and -0.3 will be dark blue, but I don't know to do that, if I
> use color table "WhiteBlue".
>
> Some parts of my script:
> ;;;;;;;;;;;;;;;; out
>   type = "x11"
>  ;type = "pdf"
> ; type = "ps"
> ; type = "ncgm"
>   wks3 = gsn_open_wks(type,"graficas/viento_10m")
>
>   gsn_define_colormap(wks3,"WhiteBlue")
>
> ......
>
> ;;;;;;;;;;;;;;;
>       ; Generate contours.
>         r_res = res
>         r_res at cnFillOn = True
>         r_res at cnInfoLabelOn         = False
>       r_res at ContourParameters = (/ -0.3, 0., 0.05 /)
>         r_res at MainTitlePos = "Center"
>         r_res at MainTitle = ""
> ;r_res at NoHeaderFooter = True
>         r_res at Footer = False
>         r_res at InitTime = False
>        ; r_res at lbOrientation        = "Vertical"
>      contour_r = wrf_contour(a,wks3,div,r_res)
>
> ........
>
>
> Can you give some ideas. please!.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list