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

WUJIE 393069045 at qq.com
Sun Aug 25 08:11:20 MDT 2019


Thanks so much, Rick. It works now.
Cheers
Jie
 




------------------ 原始邮件 ------------------
发件人: "Rick Brownrigg"<brownrig at ucar.edu>;
发送时间: 2019年8月25日(星期天) 晚上9:51
收件人: "WUJIE"<393069045 at qq.com>;
抄送: "ncl-talk"<ncl-talk at ucar.edu>;
主题: Re: [ncl-talk] Problem in controling the colors with RGB array in Bar Chart



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/239b0cd3/attachment.html>


More information about the ncl-talk mailing list