Re: cnFillPalette: last contour fill reverts to black

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 05 2013 - 13:00:30 MDT

Hi Jon,

You should note that NCL is a zero-index language. This means that your
colors are indexed 0-253 for that table, as BlueYellowRed contains 256
colors as a color map and 254 as a color palette.

Without looking at your code, it looks like you're trying to explicitly
reference a 255th color, which simply doesn't exist. There are a few ways
to manage this if you need a full 255 colors. The most common is probably
cnSpanFillPalette, which I'm pretty sure will duplicate colors at points
within the spectrum to create the extra colors if the count of your levels
exceeds the count of your colors. It's generally used for making a plot
with fewer plot levels than there are colors, however. If you are looking
to do something else with the colors, I can give you some more complicated
FillColor management suggestions as well that I tend to use in most of my

Let us know if you need any additional help...


Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
Room 1421
1225 W Dayton St, Madison, WI 53706

On Thu, Sep 5, 2013 at 12:46 PM, jonathan meyer <> wrote:

> Hi Devs,
> I've been enjoying the functionality of the cnFillPalette resource for my
> panel plots where different color tables are desired.
> I am wondering how to reset the last contour fill which is reassigned to a
> black color (foreground color).
> From the documentation:
> "If you set *cnFillPalette*<> using
> a predefined color map, it will have two fewer elements than if you set *
> wkColorMap*<> using
> the same color map. This is because the *wkColorMap*<> resource
> contains special elements (0 and 1) for the Background and Foreground colors,
> whereas the palette-type resources do not."
> My question is how to reset that color? Is it as simple as giving a named
> color to a different resource?
> For future search reference, here is the warning generated when using the
> resource and a 256 color table (resdiff@cnFillPalette =
> "BlueYellowRed")
> warning:ContourPlotSetValues: color index (255) exceeds size of palette,
> defaulting to foreground color for entry (21)
> Thanks for the time!
> Jon
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Sep 5 13:01:05 2013

This archive was generated by hypermail 2.1.8 : Mon Sep 16 2013 - 13:43:52 MDT