[ncl-talk] polyg_8.ncl

Mary Haley haley at ucar.edu
Sun Apr 23 22:35:47 MDT 2017


Hi Laura,

I'm not sure it's very useful, but there's a "draw_color_palette" function
that you can call to draw a set of colors:

At the end of the polyg_8.ncl script, add:

  draw_color_palette(wks,colors,False)

and this will draw the colors defined by "colors". (See attached image)

The important thing to note here is that "colors" is an array of color
indexes into a workstation color map. You have to make sure to call
draw_color_palette after the workstation color map has been set (by
gsn_define_colormap).  If no workstation color map is set, then the default
"ncl_default" workstation color map is in effect.

Here's the documentation and some examples:

http://www.ncl.ucar.edu/Document/Functions/Built-in/draw_color_palette.shtml

http://www.ncl.ucar.edu/Applications/color.shtml#ex9

http://www.ncl.ucar.edu/Applications/colormap.shtml#ex2a

http://www.ncl.ucar.edu/Applications/colormap.shtml#ex3a

--Mary




--Mary



On Fri, Apr 21, 2017 at 1:07 PM, Michael Notaro <mnotaro at wisc.edu> wrote:

> http://www.ncl.ucar.edu/Document/Graphics/ColorTables/WhViBlGrYeOrRe.shtml
> WhViBlGrYeOrRe color table - University Corporation for ...
> <http://www.ncl.ucar.edu/Document/Graphics/ColorTables/WhViBlGrYeOrRe.shtml>
> www.ncl.ucar.edu
> Sample NCL script usages: ;---Using the color map to define colors for
> contours or vectors res at cnFillPalette = "WhViBlGrYeOrRe"
> res at vcLevelPalette = "WhViBlGrYeOrRe ...
>
>
>
> Michael Notaro
> Associate Director
> Nelson Institute Center for Climatic Research
> University of Wisconsin-Madison
> Phone: (608) 261-1503
> Email: mnotaro at wisc.edu
>
>
> ------------------------------
> *From:* ncl-talk-bounces at ucar.edu <ncl-talk-bounces at ucar.edu> on behalf
> of Laura Fowler <laura at ucar.edu>
> *Sent:* Friday, April 21, 2017 2:03 PM
> *To:* ncl-talk at ucar.edu
> *Subject:* [ncl-talk] polyg_8.ncl
>
> Hello:
>
> I have kind of "silly" questions about the variable "colors" in the
> script polyg_8.ncl.
> colors = (/10,30,38,48,56,66,74,94/)
>
> Where do I find which color corresponds to each number. I looked at
> the web page on color tables but did not find it.
>
> Many thanks,
> Laura
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628 <(303)%20497-1628>
>
> !-----------------------------------------------------------
> --------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> ncl-talk Info Page - University Corporation for ...
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
> mailman.ucar.edu
> Unsubscribing from ncl-talk, changing subscription options, getting your
> password, etc.
>
>
>
> _______________________________________________
> 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/20170423/527616bf/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polyg.000001.png
Type: image/png
Size: 9575 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170423/527616bf/attachment.png 


More information about the ncl-talk mailing list