[ncl-talk] Problem in controling the colors with RGB array in Bar Chart

Rick Brownrigg brownrig at ucar.edu
Sun Aug 25 07:51:02 MDT 2019


Firstly, thank you for the nice clean example that illustrates the problem.


The named colors are indeed strings and as such should be surrounded by
quotes. The RGBa values on the other hand are numerics -- try removing the
quotes around the RGB-triplets.

Hope that helps...
Rick

On Sun, Aug 25, 2019 at 4:47 AM WUJIE via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi NCL experts,
>
> In the NCL Bar Chart, one can easily control the colors of the bar by
> using Named Color for "gsnXYBarChartColors".
> However, below errors occurs if I use the RGB array for
> "gsnXYBarChartColors":
>
> (0) convert_color_to_rgba: Error: unknown color type.
> (0)   Returning all missing values.
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
> warning:_NhlGetGksCi:Invalid Color index=-1073741824
>
> To show my question better I wrote a simple test script, which is attached
> here. It works using named color but fail when RGB array is used for
> gsnXYBarChartColors.
> Does anyone can tell me how can I use self-defined color (with RGB values)
> for colors of Bar Chart?
>
> Thanks in advance.
>
> Jie Wu
>
> _______________________________________________
> 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/20190825/50697496/attachment.html>


More information about the ncl-talk mailing list