[ncl-talk] color index exceeds size of palette
Rick Brownrigg
brownrig at ucar.edu
Sat May 12 10:41:22 MDT 2018
Hi,
Historically, the first two colors in a colormap were reserved as
"background" and "foreground" colors, typically black and white. To
preserve backwards compatibility, that is still the case when colors are
associated with the *workstation*. However, in the case of colormaps that
are loaded into a *palette* that is expressly used for contouring, vectors,
streamlines, etc. those first two colors are stripped out of the colormap.
So I think the short answer is you want to adjust all your color indices by
-2 (except of course the -1 indexes designating "TRANSPARENT".
Looking at the color palette you are using:
http://ncl.ucar.edu/Document/Graphics/ColorTables/BlueDarkRed18.shtml
We see the indices going from 2 to 19
On Sat, May 12, 2018 at 7:58 AM, Anne <anne.seidenglanz at unive.it> wrote:
> Hi all,
>
> I want to plot some anomaly; for these difference plots I have
> used cnLevelSelectionMode = "ExplicitLevels" in order to specify both my
> contour levels as well as specific colors after that. I have used the
> pre-defined "BlueDarkRed18" color table; my specified cnFillColors are well
> within the range of this colour table (3 to 18; see script attached),
> nevertheless I receive the error message
>
> "color index exceeds size of palette, defaulting to foreground color of
> entry"
>
> Why is this? Sorry if I have missed something from the documentation.
> I have attached both the script and an example plot (last plot).
>
> Any help is appreciated,
> thanks
> Anne
>
> Nota automatica aggiunta dal sistema di posta.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180512/c361d2d1/attachment.html>
More information about the ncl-talk
mailing list