<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px"><div id="yui_3_16_0_1_1445600537057_5378"><span id="yui_3_16_0_1_1445600537057_5377">Hi all and Mary</span></div><div id="yui_3_16_0_1_1445600537057_5804"><span id="yui_3_16_0_1_1445600537057_5377">I am unable to do it and sorry for bothering you. <br></span></div><div id="yui_3_16_0_1_1445600537057_5964"><span id="yui_3_16_0_1_1445600537057_5377"><br></span></div><div dir="ltr" id="yui_3_16_0_1_1445600537057_5504"><span id="yui_3_16_0_1_1445600537057_5377">I didnt get the concept behind adding a unique_string every time the gsn_add_polymarker is called as you have said. Kindly explain again.&nbsp; I did try that but default markers (black) are plotted. <br></span></div><div id="yui_3_16_0_1_1445600537057_6275" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377"><br></span></div><div id="yui_3_16_0_1_1445600537057_6458" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">This time I tried using <b>where</b> function as I had used before for plotting the text. here is the part of the script that I m trying along with the data. <br></span></div><div id="yui_3_16_0_1_1445600537057_6340" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">;---------Adding Markers &amp; Coloring them according to the RF value<br class="" id="yui_3_16_0_1_1445600537057_6277">&nbsp;&nbsp;&nbsp; nrf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = dimsizes(rf)&nbsp;&nbsp; <br class="" id="yui_3_16_0_1_1445600537057_6279">;&nbsp;&nbsp;&nbsp; print(nrf)<br class="" id="yui_3_16_0_1_1445600537057_6281"><br class="" id="yui_3_16_0_1_1445600537057_6283">&nbsp;&nbsp;&nbsp; color_of_marker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = new(nrf,string)<br class="" id="yui_3_16_0_1_1445600537057_6285">&nbsp;&nbsp;&nbsp; dont_mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "&nbsp; "<br class="" id="yui_3_16_0_1_1445600537057_6287">&nbsp;&nbsp;&nbsp; dont_mark@_FillValue&nbsp;&nbsp;&nbsp;&nbsp; = "missing"</span></div><div id="yui_3_16_0_1_1445600537057_6513" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377"><br></span></div><div id="yui_3_16_0_1_1445600537057_6512" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">&nbsp;&nbsp;&nbsp; color_of_marker&nbsp;&nbsp; = where((rf.eq.0.0),dont_mark,dont_mark) <br class="" id="yui_3_16_0_1_1445600537057_6291">&nbsp;&nbsp;&nbsp; color_of_marker&nbsp;&nbsp; = where(((rf.ge.0.1).and.(rf.lt.2.4)),"Green",dont_mark)<br class="" id="yui_3_16_0_1_1445600537057_6293">&nbsp;&nbsp;&nbsp; color_of_marker&nbsp;&nbsp; = where(((rf.ge.2.5).and.(rf.lt.7.5)),"Blue",dont_mark)<br class="" id="yui_3_16_0_1_1445600537057_6295">&nbsp;&nbsp;&nbsp; color_of_marker&nbsp;&nbsp; = where(((rf.ge.7.6).and.(rf.lt.35.5)),"Yellow",dont_mark)<br class="" id="yui_3_16_0_1_1445600537057_6297"><br class="" id="yui_3_16_0_1_1445600537057_6299"><br class="" id="yui_3_16_0_1_1445600537057_6301">printVarSummary(dont_mark)<br class="" id="yui_3_16_0_1_1445600537057_6303"><b id="yui_3_16_0_1_1445600537057_6372">print(color_of_marker)&nbsp;&nbsp; ; Array of 295 strings is printed corresponding to RF value&nbsp;&nbsp;&nbsp;</b>&nbsp;&nbsp;&nbsp; <br class="" id="yui_3_16_0_1_1445600537057_6305">;<br class="" id="yui_3_16_0_1_1445600537057_6307"><br class="" id="yui_3_16_0_1_1445600537057_6309">&nbsp;&nbsp;&nbsp;&nbsp; res_mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True<br class="" id="yui_3_16_0_1_1445600537057_6311">&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerIndex&nbsp;&nbsp; = 1&nbsp; ; 17 predefined markers available<br class="" id="yui_3_16_0_1_1445600537057_6313">&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerSizeF&nbsp;&nbsp; = 0.012<br class="" id="yui_3_16_0_1_1445600537057_6315"><br class="" id="yui_3_16_0_1_1445600537057_6317"><br class="" id="yui_3_16_0_1_1445600537057_6319">&nbsp;&nbsp;&nbsp;&nbsp; do n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0,&nbsp; nrf-1<br class="" id="yui_3_16_0_1_1445600537057_6321"><br class="" id="yui_3_16_0_1_1445600537057_6323">&nbsp;&nbsp;&nbsp; ;&nbsp;&nbsp; if ((rf(n).ge.0.1).and.(rf(n).lt.2.5)) then<br class="" id="yui_3_16_0_1_1445600537057_6325"><br class="" id="yui_3_16_0_1_1445600537057_6327">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerColor&nbsp; = color_of_marker(n)<br class="" id="yui_3_16_0_1_1445600537057_6329">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = unique_string("poly")<br class="" id="yui_3_16_0_1_1445600537057_6331">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plot@$str$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = gsn_add_polymarker(wks,plot,lon,lat,res_mark)<br class="" id="yui_3_16_0_1_1445600537057_6333">&nbsp;&nbsp;&nbsp; <br class="" id="yui_3_16_0_1_1445600537057_6335">&nbsp;&nbsp;&nbsp; end do<br class="" id="yui_3_16_0_1_1445600537057_6337"></span></div><div id="yui_3_16_0_1_1445600537057_6932" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">String variable "dont_mark" is not being converted to Color???? <br></span></div><div id="yui_3_16_0_1_1445600537057_7144" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">warning:Error retrieving resource gsMarkerColor from args - Ignoring Arg<br class="" id="yui_3_16_0_1_1445600537057_7017">fatal:CvtStringToColorIndex: Unable to convert string "&nbsp; " to requested type<br class="" id="yui_3_16_0_1_1445600537057_7019">warning:Error retrieving resource gsMarkerColor from args - Ignoring Arg<br class="" id="yui_3_16_0_1_1445600537057_7021">fatal:CvtStringToColorIndex: Unable to convert string "&nbsp; " to requested type<br class="" id="yui_3_16_0_1_1445600537057_7023">warning:Error retrievin<br class="" id="yui_3_16_0_1_1445600537057_6339"></span></div><div id="yui_3_16_0_1_1445600537057_7192" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377"><br></span></div><div id="yui_3_16_0_1_1445600537057_7191" dir="ltr"><span id="yui_3_16_0_1_1445600537057_5377">Thanks</span></div><div id="yui_3_16_0_1_1445600537057_5372">&nbsp;</div><div id="yui_3_16_0_1_1445600537057_5505" class="signature">Geeta.</div>  <br><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Friday, 23 October 2015 3:33 AM, Mary Haley &lt;haley@ucar.edu&gt; wrote:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv9047987739"><div><div dir="ltr"><div class="yiv9047987739gmail_default" style="font-size:small;">[Please don't CC me on questions that are sent to ncl-talk.&nbsp; I'm on ncl-talk, so I will see your follow-up messages.]</div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;">You need to have a unique identifier for each time you call gsn_add_xxxxx.</div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;">The easiest way to do this, without having to predefine an array to hold all the objects, is to use unique_string to generate a unique string name, and then use this string name as an attribute name.</div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;">So, instead of:</div><div class="yiv9047987739gmail_default" style="font-size:small;">







<div class="yiv9047987739">&nbsp; &nbsp; &nbsp;dum =<span class="yiv9047987739">gsn_add_polymarker</span>(wks,plot,lon,lat,res_mark)</div><div class="yiv9047987739">use:</div></div><div class="yiv9047987739gmail_default" style="font-size:small;">&nbsp; str = unique_string("poly")</div><div class="yiv9047987739gmail_default" style="font-size:small;">&nbsp; plot@$str$ =&nbsp;<span class="yiv9047987739">gsn_add_polymarker</span>(wks,plot,lon,lat,res_mark)</div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;">--Mary</div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv9047987739gmail_default" style="font-size:small;"><br clear="none"></div>







</div><div class="yiv9047987739yqt5844646733" id="yiv9047987739yqt85988"><div class="yiv9047987739gmail_extra"><br clear="none"><div class="yiv9047987739gmail_quote">On Thu, Oct 22, 2015 at 12:37 PM, Geeta Geeta <span dir="ltr">&lt;<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>&gt;</span> wrote:<br clear="none"><blockquote class="yiv9047987739gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px;"><div><span>Hi all. <br clear="none"></span></div><div><span>I was trying to give a different color to the rainfall range (value) recently. My actual data is some 300+ stations an when I run that script, the plot was all crowded . <br clear="none"></span></div><div><span><br clear="none"></span></div><div><span>I thought of giving a different color to the marker itself without adding the text/rainfall value to the plot. <br clear="none"></span></div><div dir="ltr"><span>here is that part&nbsp;</span></div><div dir="ltr"><span>;---------Adding Markers according to rainfall value<br clear="none"><br clear="none">&nbsp; nrf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = dimsizes(rf)<br clear="none">&nbsp; markers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = new(dimsizes(rf),string)<br clear="none">&nbsp; dont_mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "red"<br clear="none"><br clear="none">&nbsp; res_mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True<br clear="none">&nbsp; res_mark@gsMarkerIndex&nbsp; = 1&nbsp; ; 17 predefined markers available<br clear="none">&nbsp; res_mark@gsMarkerSizeF&nbsp; = 0.012<br clear="none">;&nbsp; res_mark@gsMarkerColor = "black"<br clear="none"><br clear="none">&nbsp; do n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0,&nbsp; nrf-1<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp; if (rf(n).eq.0.0) then<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Black"<br clear="none">;&nbsp;&nbsp;&nbsp;&nbsp; dum =gsn_add_polymarker(wks,plot,lon,lat,res_mark)<br clear="none"><br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ((rf(n).ge.0.1).and.(rf(n).lt.2.4)) then<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Blue"<br clear="none"><br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ((rf(n).ge.2.5).and.(rf(n).lt.7.5)) then<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res_mark@gsMarkerColor&nbsp; = "Red"<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<br clear="none">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<br clear="none">;&nbsp; end do<br clear="none"><br clear="none">&nbsp;&nbsp;&nbsp;&nbsp; dum =gsn_add_polymarker(wks,plot,lon,lat,res_mark)<br clear="none">&nbsp; end do<br clear="none">print(rf+res_mark@gsMarkerColor)</span></div><div dir="ltr"><br clear="none"><span></span></div><div dir="ltr"><span>; ----------Now adding text--------------------</span></div><div dir="ltr"><span>I get warning like this and the Plot&nbsp; has Only Black markers????<br clear="none"></span></div><div dir="ltr"><span>warning:TransformPostDraw: tfPolyDrawList element 273 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 274 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 275 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 276 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 277 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 278 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 279 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 280 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 281 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 282 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 283 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 284 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 285 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 286 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 287 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 288 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 289 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 290 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 291 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 292 is invalid<br clear="none">warning:TransformPostDraw: tfPolyDrawList element 293 is invalid<br clear="none">aditya@agniilap:~/geeta/ncl$ <br clear="none">kindly suggest.&nbsp;</span></div><div dir="ltr"><span><br clear="none"></span></div></div></div></blockquote></div><br clear="none"></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>