Re: color bar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sun Feb 06 2011 - 14:50:57 MST

Hi Yongzuo,

In this case, the color bar was "chosen accidentally". You can see the
full code for this example at:

http://www.ncl.ucar.edu/Applications/Scripts/overlay_5.ncl

The contour levels in this case are picked by NCL, where it tried to
pick "nice" levels that are equally-spaced through the data. It chose
levels (/-24, -20, -16, ..., 0, 4, 8, 12/).

The labelbar is not explicitly created either. In this case, it's
created by NCL based on the number of contour levels and color map
that is chosen ("testcmap"). Since "gsnSpreadColors" was set to True,
this tells NCL to span the "testcmap" color map starting at color 2
(the first color is color 0), and ending at the last color, using
equally-spaced indexes through the color map. Try running this script
with "gsnSpreadColors" set to False, and you'll see the difference.

You can see the color map at:

http://www.ncl.ucar.edu/Document/Graphics/ColorTables/testcmap.shtml

It so happens that this color map has a series of white colors in the
middle, so the middle of the labelbar has white.

If you are trying to create contours such that you have white in the
middle, and then different colors for negative and positive contours,
then see example 3 at:

http://www.ncl.ucar.edu/Applications/contourLev.shtml

It uses the "ExplicitLevels" mode to control the contour levels, and
"cnFillColors" to control the exact colors.

You can also look at the function symMinMaxPlt:

http://www.ncl.ucar.edu/Document/Functions/Contributed/symMinMaxPlt.shtml

--Mary

On Feb 5, 2011, at 12:33 PM, Li, Yongzuo wrote:

> HI,
>
> Here is the NCL official example plot
>
> http://www.ncl.ucar.edu/Applications/Images/overlay_5_lg.png
>
> I have a question about the color bar. The negative values are in
> green,
> blue colors (cold color) and the positive values are in yellow, red
> colors ( hot color).
> They are divided by white color (-2.5 to 0).
>
> Is the color bar made accidentally or controlled by some NCL
> parameters?
>
> Thanks.
>
> Yongzuo
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Feb 6 14:51:03 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 16:11:42 MST