[ncl-talk] xy plot: line with varying colors based on its value

Adam Phillips asphilli at ucar.edu
Mon Feb 11 16:45:13 MST 2019


Hi Tabish,
It's possible to create a plot like that, but it would be rather difficult.
You cannot use xyLineColors to do what you want. I do not believe NCL can
change the color of a line drawn between two given data points. What I
think you would need to do would be to call either gsn_add_polyline or
gsn_csm_xy repeatedly for every line segment (of one color) that you want
to draw. Coding that would take some time. I wonder if an external software
package (like Illustrator) might be a better option.
Adam


On Sat, Feb 9, 2019 at 9:55 AM Tabish Ansari <tabishumaransari at gmail.com>
wrote:

> Hi
>
> I want to draw an xy plot with 20 lines (different set of data) stacked on
> top of each other, but I don't want each of these lines fully in a single
> color. Instead I want these lines to keep changing their color based on
> their value.
>
> Say the data varies between 0 to 40. I want to create 8 intervals of range
> = 5 units, and therefore 8 different colors:
> say lightblue - blue - green - yellowgreen - yellow - orange - red -
> purple.
>
> Is it possible to keep changing the xyLineColors resource accordingly?
>
> Thanks
>
> Tabish
>
> Tabish U Ansari
> PhD student, Lancaster Environment Center
> Lancaster Univeristy
> Bailrigg, Lancaster,
> LA1 4YW, United Kingdom
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190211/e7c06986/attachment.html>


More information about the ncl-talk mailing list