<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_1444929970984_4890" dir="ltr">Yes I meant "clumsy " as the values close to the dots. <br></div><div id="yui_3_16_0_1_1444929970984_4845" dir="ltr">Yes all your suggestions are working very well. <br></div><div id="yui_3_16_0_1_1444929970984_4844" dir="ltr">Thanks a lot for that. <br></div><div id="yui_3_16_0_1_1444929970984_5061" dir="ltr"><br></div><div id="yui_3_16_0_1_1444929970984_5024" dir="ltr">I have another question. I was wondering if I can give different colours to the values. I mean if rainfall in in range of 0.1-2.4, then I write the actual value by Yellow color<br></div><div id="yui_3_16_0_1_1444929970984_5117" dir="ltr">if 2.5 -10.0 say then I write the actual value by Green color</div><div dir="ltr"><br></div><div dir="ltr">Instead of all uniform colour like Blue I have chosen <br></div><div dir="ltr"><br></div><div dir="ltr">For this I tried with if statement before the Text Res like this. <br></div><div id="yui_3_16_0_1_1444929970984_5158" dir="ltr"><br class="" id="yui_3_16_0_1_1444929970984_5119"> txres = True<br class="" id="yui_3_16_0_1_1444929970984_5121"> txres@txFontHeightF = 0.012<br class="" id="yui_3_16_0_1_1444929970984_5123"> txres@txFont = "helvetica-bold"<br class="" id="yui_3_16_0_1_1444929970984_5125">;<br class="" id="yui_3_16_0_1_1444929970984_5127"> if any(rf.le.4.1) then<br class="" id="yui_3_16_0_1_1444929970984_5129"> txres@txFontColor = "Blue"<br class="" id="yui_3_16_0_1_1444929970984_5131">; txres@txFontQuality = "High"<br class="" id="yui_3_16_0_1_1444929970984_5133">; txres@txJut = "TopRight "<br class="" id="yui_3_16_0_1_1444929970984_5135">else<br class="" id="yui_3_16_0_1_1444929970984_5143">if any(rf.gt.4.1) then<br class="" id="yui_3_16_0_1_1444929970984_5145">txres@txFontColor = "Red"<br class="" id="yui_3_16_0_1_1444929970984_5147">end if<br class="" id="yui_3_16_0_1_1444929970984_5149">end if<br class="" id="yui_3_16_0_1_1444929970984_5151"> <br class="" id="yui_3_16_0_1_1444929970984_5153"> text = gsn_add_text(wks,plot," "+sprintf("%9.4g",rf),lon,lat,txres)<br class="" id="yui_3_16_0_1_1444929970984_5155"></div><div id="yui_3_16_0_1_1444929970984_5270" dir="ltr"><br></div><div id="yui_3_16_0_1_1444929970984_5529" dir="ltr">But It is plotted in Blue only. <br></div><div id="yui_3_16_0_1_1444929970984_5530" dir="ltr">my input file looks like this. <br></div><div id="yui_3_16_0_1_1444929970984_5577" dir="ltr">lat lon hgt rf<br></div><div id="yui_3_16_0_1_1444929970984_5645" dir="ltr">12.57 77.38 919.6 5.6<br class="" id="yui_3_16_0_1_1444929970984_5478">12.3 78.18 882.2 67.<br class="" id="yui_3_16_0_1_1444929970984_5480">13.06 77.24 900 0.1<br class="" id="yui_3_16_0_1_1444929970984_5482">13.26 77.24 900 4.1<br class="" id="yui_3_16_0_1_1444929970984_5484"><br></div><div id="yui_3_16_0_1_1444929970984_5660" dir="ltr">If I dont use any function then I get error. <br></div><div id="yui_3_16_0_1_1444929970984_4842"> </div><div id="yui_3_16_0_1_1444929970984_4841" 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 Wednesday, 14 October 2015 12:34 AM, Mary Haley <haley@ucar.edu> wrote:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv0496405419"><div><div dir="ltr"><div class="yiv0496405419gmail_default" style="font-size:small;">Geeta,</div><div class="yiv0496405419gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv0496405419gmail_default" style="font-size:small;">I'm not sure what you mean by "messy". </div><div class="yiv0496405419gmail_default" style="font-size:small;"><br clear="none"></div><div class="yiv0496405419gmail_default" style="font-size:small;">You are setting txPosXF and txPosYF, but these resources are meaningless, because the "gsn_add_text" function has the X and Y positions as part of its argument list, in your case, the "lon" and "lat" arguments:</div><div class="yiv0496405419gmail_default" style="font-size:small;">
<div class="yiv0496405419"> text = <span class="yiv0496405419">gsn_add_text</span>(wks,plot,<span class="yiv0496405419">sprintf</span>(<span class="yiv0496405419">"%9.4g"</span>,rf),lon,lat,txres)</div><div class="yiv0496405419">So, you should be trying to change your lon and lat values, and not txPosXF and txPosYF.</div><div class="yiv0496405419">If by "messy" you mean that the text string is touching the markers in a couple of places, then there are several things you can do.</div><div class="yiv0496405419">One is to simply add some extra spaces before the text strings. You can do this by changing the format in the "sprintf" call to have more fields:</div><div class="yiv0496405419">
</div><div class="yiv0496405419"> text = <span class="yiv0496405419">gsn_add_text</span>(wks,plot,<span class="yiv0496405419">sprintf</span>(<span class="yiv0496405419">"%11.4g"</span>,rf),lon,lat,txres)</div><div class="yiv0496405419">or by adding a space:</div><div class="yiv0496405419">
</div><div class="yiv0496405419"> text = <span class="yiv0496405419">gsn_add_text</span>(wks,plot," " + <span class="yiv0496405419">sprintf</span>(<span class="yiv0496405419">"%9.4g"</span>,rf),lon,lat,txres)</div><div class="yiv0496405419">You can also add a small delta value to the "lon" position:</div><div class="yiv0496405419">
</div><div class="yiv0496405419"> text = <span class="yiv0496405419">gsn_add_text</span>(wks,plot,<span class="yiv0496405419">sprintf</span>(<span class="yiv0496405419">"%9.4g"</span>,rf),lon+0.1,lat,txres)</div><div class="yiv0496405419">--Mary</div><div class="yiv0496405419"><br clear="none"></div><div class="yiv0496405419"><br clear="none"></div>
<div class="yiv0496405419"><br clear="none"></div><div class="yiv0496405419"><br clear="none"></div></div></div><div class="yiv0496405419gmail_extra"><br clear="none"><div class="yiv0496405419gmail_quote">On Mon, Oct 12, 2015 at 11:14 AM, Geeta Geeta <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>></span> wrote:<br clear="none"><blockquote class="yiv0496405419gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv0496405419yqt8867372055" id="yiv0496405419yqt31131"><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. <br clear="none"></span></div><div><span>I am plotting station rainfall and my data looks like </span></div><div dir="ltr"><span>13.57 77.38 919.6 5.6<br clear="none">12.3 78.18 882.2 67.<br clear="none">13.06 77.24 900 0.1<br clear="none">13.06 77.24 900 0.1<br clear="none">~ </span></div><div dir="ltr"><span>The Rf is in the 4th Col and it gets plotted. But when I try to change the position of the text, I am unable to do it. <br clear="none"></span></div><div dir="ltr"><span>My script is attached and the Figure. </span></div><div dir="ltr"><br clear="none"><span></span></div><div dir="ltr"><span>essentially, <br clear="none"></span></div><div dir="ltr"><span> <br clear="none"></span></div><div dir="ltr"><span> txres@txPosXF = 0.775<br clear="none"> txres@txPosYF = -5.05<br clear="none">; txres@txAngleF = 40.00 </span></div><div dir="ltr"><br clear="none"><span></span></div><div dir="ltr"><span>Since I am unable to change the above two, my plot looks a little messy. <br clear="none"></span></div><div dir="ltr"><br clear="none"><span></span></div><div dir="ltr"><span>can someone suggest???<span class="yiv0496405419HOEnZb"><font color="#888888"><br clear="none"></font></span></span></div><span class="yiv0496405419HOEnZb"><font color="#888888"></font></span><div dir="ltr"><span></span></div><div> </div><div>Geeta.</div></div></div></div><br clear="none">_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><br></div> </div> </div> </div></div></body></html>