<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I don&#39;t know of any way of doing this other than to draw the line piecewise.  What about something like:<br><br></div><div>datadims = dimsizes(data)  ; assuming your data is 2xN<br></div>numlinesegs = datadims(1) - 1<br></div><div>linesegs = new((/ numlinesegs/), graphic)<br></div>do i=1,numlinesegs<br></div>  color = ....appropriate logic to determine the color here...<br></div>  res@gsLineColor = color<br></div>  linesegs(i) = gsn_add_polyline(wks, plot, data(0, i-1:i), data(1, i-1:i), res)<br></div>end do<br><br></div>This is not particularly efficient, and there may be better ways of doing this, but that should work.<br><br></div>HTH...<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 30, 2016 at 12:48 AM, grace <span dir="ltr">&lt;<a href="mailto:313695096@qq.com" target="_blank">313695096@qq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi:</div>
<div>  All,I am trying to  draw a line  that emphasize every parts of it with different colors.</div>
<div>I have found the example xy_12.ncl which highlight the wanted part by split the data.</div>
<div>But I want to draw a line which have different colors according to its y numberical value,just like the plot below.</div>
<div><img src="cid:0356412F@5DA70B25.65116658.png"></div>
<div>If I split the data ,that would be a huge work.</div>
<div>Have anybody drawed plot like this ?Any information will be appreciated.</div>
<div> </div>
<div><span style="LINE-HEIGHT:23px;FONT-FAMILY:&#39;lucida Grande&#39;,Verdana,&#39;Microsoft YaHei&#39;"></span> </div>
<div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>