[ncl-talk] Changing a color in a color table to transparent

Ty Buckingham ty.buckingham at manchester.ac.uk
Tue Apr 10 17:55:51 MDT 2018


Hi there,

Is it possible to change a single color in an already constructed color map to transparent?

As an example: I wish to use the "hotcold_18lev" color table, but wish to change the white to transparent. I do not have editing permission to the NCARG root hence cannot change the RGBA value directly. Is it possible to change it within the NCL script?

Initially, I tried this:


cmap                = read_colormap_file("hotcold_18lev")

cmap(10:11,)        = 0.0                ; makes whites transparent

res at cnFillColors    = cmap


Yet received the error:


fatal:Error in subscript, normal subscripting is being used, make sure named subscripting has not been used


which is related to the "cmap(10:11,)" line.


Thanks in advance!

Ty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180410/bb410417/attachment.html>


More information about the ncl-talk mailing list