<div dir="ltr"><div class="gmail_default" style="font-size:small">[Please don't CC me on questions that are sent to ncl-talk. I'm on ncl-talk, so I will see your follow-up messages.]</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You need to have a unique identifier for each time you call gsn_add_xxxxx.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_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="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So, instead of:</div><div class="gmail_default" style="font-size:small">
<p class=""> dum =<span class="">gsn_add_polymarker</span>(wks,plot,lon,lat,res_mark)</p><p class="">use:</p></div><div class="gmail_default" style="font-size:small"> str = unique_string("poly")</div><div class="gmail_default" style="font-size:small"> plot@$str$ = <span class="">gsn_add_polymarker</span>(wks,plot,lon,lat,res_mark)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div>
</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 12:37 PM, Geeta Geeta <span dir="ltr"><<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_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></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></span></div><div><span><br></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></span></div><div dir="ltr"><span>here is that part </span></div><div dir="ltr"><span>;---------Adding Markers according to rainfall value<br><br> nrf = dimsizes(rf)<br> markers = new(dimsizes(rf),string)<br> dont_mark = "red"<br><br> res_mark = True<br> res_mark@gsMarkerIndex = 1 ; 17 predefined markers available<br> res_mark@gsMarkerSizeF = 0.012<br>; res_mark@gsMarkerColor = "black"<br><br> do n = 0, nrf-1<br> if (rf(n).eq.0.0) then<br> res_mark@gsMarkerColor = "Black"<br>; dum =gsn_add_polymarker(wks,plot,lon,lat,res_mark)<br><br> else if ((rf(n).ge.0.1).and.(rf(n).lt.2.4)) then<br> res_mark@gsMarkerColor = "Blue"<br><br> else if ((rf(n).ge.2.5).and.(rf(n).lt.7.5)) then<br> res_mark@gsMarkerColor = "Red"<br> end if<br> end if<br> end if<br>; end do<br><br> dum =gsn_add_polymarker(wks,plot,lon,lat,res_mark)<br> end do<br>print(rf+res_mark@gsMarkerColor)</span></div><div dir="ltr"><br><span></span></div><div dir="ltr"><span>; ----------Now adding text--------------------</span></div><div dir="ltr"><span>I get warning like this and the Plot has Only Black markers????<br></span></div><div dir="ltr"><span>warning:TransformPostDraw: tfPolyDrawList element 273 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 274 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 275 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 276 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 277 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 278 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 279 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 280 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 281 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 282 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 283 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 284 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 285 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 286 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 287 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 288 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 289 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 290 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 291 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 292 is invalid<br>warning:TransformPostDraw: tfPolyDrawList element 293 is invalid<br>aditya@agniilap:~/geeta/ncl$ <br>kindly suggest. </span></div><div dir="ltr"><span><br></span></div></div></div></blockquote></div><br></div>