[ncl-talk] Color names

Buzan, Jonathan jbuzan at purdue.edu
Wed Jul 7 10:53:19 MDT 2021


Hi Rick,

That worked!  Nice trick!

Cheers,
-Jonathan


[cid:F5B7FD54-3D1F-4772-ACC8-E59768B64823 at unibe.ch]



On Jul 7, 2021, at 6:46 PM, Rick Brownrigg <brownrig at ucar.edu<mailto:brownrig at ucar.edu>> wrote:

Oh, BTW:  read_colormap_file()  will always return an array of Nx4, ie., RGB-alpha tuples.  If you have previously set cnFillPalette with a named color map that consisted of only RGB tuples, then you might get an mis-match error if you try and reassign cnFillPalette as I suggested. In that case, be sure to use the reassignment operator :=

res at cnFillPalette := cmap(::-1,:)

RB

On Wed, Jul 7, 2021 at 10:43 AM Rick Brownrigg <brownrig at ucar.edu<mailto:brownrig at ucar.edu>> wrote:
How about something like:

     cmap = read_colormap_file("MPL_PuOr")
     res at cnFillPalette = cmap(::-1,:)

Rick

On Wed, Jul 7, 2021 at 10:21 AM Buzan, Jonathan <jbuzan at purdue.edu<mailto:jbuzan at purdue.edu>> wrote:
Hi Rick,

To get more detailed, I need to reverse colors on some maps.

Thanks,
-Jonathan


  res at cnFillPalette = "BlueDarkRed18"
; need to reverse MPL_PuOr
  res at cnFillPalette = “MPL_PuOr"

<T_Analysis_Plot.png>



On Jul 7, 2021, at 11:03 AM, Buzan, Jonathan via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:

Hi Rick,

Thanks for your help. I was mostly concerned about finding similarly sized color tables in the color table and using the cnFillPalette to call the tables, so that each plot would have a unique colorbar while still using the same plot res.

Cheers,
-Jonathan



On Jul 6, 2021, at 5:21 PM, Rick Brownrigg <brownrig at ucar.edu<mailto:brownrig at ucar.edu>> wrote:

Hi Jonathan,

I don't fully understand what you are trying to do, and why you might need named colors. So taking a guess here, there is the read_colormap_file() that you can use to read one of the colormaps show in the gallery link, and from that you can directly assign the result to cnFillPalette

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

HTH...
Rick


On Tue, Jul 6, 2021 at 6:54 AM Buzan, Jonathan via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi NCL,

The predefined colormaps are excellent examples of colors.
However, from my experience, the   gsn_define_colormap(wks, colors)  limits the flexibility of NCL.

Whereas, the  res at cnFillPalette has flexibility.

I am attempting to generate a multi paneled plot, and switching the  res at cnFillPalette, but I still want to use the color maps.

Is there a page that has “named colors” of the color maps?
https://www.ncl.ucar.edu/Document/Graphics/named_colors.shtml
This page has example colors, but I find it difficult to reproduce these colormaps:
https://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml


Cheers,
-Jonathan


_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210707/849a7882/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: T_Analysis_Plot_TEST.png
Type: image/png
Size: 219820 bytes
Desc: T_Analysis_Plot_TEST.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210707/849a7882/attachment.png>


More information about the ncl-talk mailing list