<div dir="ltr">Hi Nick,<div>I think you can apply some of the coding of barchart example #6 to your situation, especially if every single bar is above the reference line.</div><div><a href="http://www.ncl.ucar.edu/Applications/bar.shtml#ex6" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/bar.shtml#ex6</a><br></div><div><br></div><div>I think it's just a matter of setting up an array that has the colors you want, and then passing that array to gsnAboveYRefLineBarColors.</div><div>; xyarr = the array to be plotted</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">colors = new(dimsizes(xyarr),"string")</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">colors = "green"</div></div><div>vals = ind(xyarr.ge.1000) </div><div><br></div><div>colors(vals) = "blue"</div><div>print(xyarr+" "+colors)</div><div>res@gsnYRefLine = 0. ; reference line <br></div><div>res@gsnAboveYRefLineBarColors = colors ; assigns each bar color sequentially.</div><div><br></div><div>If you have bars both above and below a reference line, you will need to do something similar to the above but set the bar colors using gsnXYBarChartColors2 as is shown in the second part of example #6 above.</div><div><br></div><div>If you have any further queries please respond to the ncl-talk email list.</div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 3, 2018 at 6:04 PM, NB <span dir="ltr"><<a href="mailto:nbarlow30@gmail.com" target="_blank">nbarlow30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is there a simple if/else/where/? statement to set <i>gsnAboveYRefLineColor </i>based on values in an array? <div><br></div><div>e.g. values above 1000, the color is blue. Else, the color is green. <br><div><br></div><div>Thanks. </div><div><br></div><div>-nick</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>