<div dir="ltr"><div>Hi,<br><br></div><div>You used -1 as _FillValue for variable "t2". Note it is an integer value -- what type is the array t2 -- float or int? In any case, you created the formatted string array "points" from t2 as "%3.0f", so that any data values in t2 that were -1 are now " -1", and thus it seems your _FillValue should be " -1". Did you do this, and do the types between data and _FillValue agree everywhere?<br><br></div><div>If that's not the issue, I think we may need to see script and dataset to figure out what the issue is.<br><br></div><div>HTH...<br></div><div>Rick<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 17, 2017 at 12:48 PM, Stavros Dafis <span dir="ltr"><<a href="mailto:sdafis@cc.uoi.gr" target="_blank">sdafis@cc.uoi.gr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Rick, thank you for your suggestion, I have tried to assign both the<br>
FillValue and the missing value (@missing_value) but nothing seems to work.<br>
<br>
I forgot to mention that I am using NCL 6.2.0, 6.3.0 and 6.4.0, on different<br>
machines.<br>
<span class="im HOEnZb"><br>
<br>
--<br>
Stavros NTAFIS (DAFIS)<br>
------------------------------<wbr>-----------------<br>
Physicist - Meteorologist, M.Sc.<br>
Research Associate, National Observatory of Athens<br>
<a href="tel:%28%2B33%299%2081%2094%2022%2012" value="+33981942212">(+33)9 81 94 22 12</a>, Mobile: <a href="tel:%2B30%20697%2004%2020%20242" value="+306970420242">+30 697 04 20 242</a><br>
---------------<br>
Weather charts:<br>
<a href="http://www.meteo.gr" rel="noreferrer" target="_blank">http://www.meteo.gr</a><br>
<a href="http://www.meteo.gr/meteomaps/" rel="noreferrer" target="_blank">http://www.meteo.gr/meteomaps/</a><br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5">Quoting Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>>:<br>
<br>
> Hi Stavros,<br>
><br>
> I don't know for certain, but I suspect you need to assign the _FillValue<br>
> to the string array "points" that you constructed from "t2" (I don't see<br>
> how the attributes from t2 would carry to points via the sprintf() ).<br>
><br>
> Hope that helps...<br>
> Rick<br>
><br>
> On Sun, Apr 16, 2017 at 12:56 PM, Stavros Dafis <<a href="mailto:sdafis@cc.uoi.gr">sdafis@cc.uoi.gr</a>> wrote:<br>
><br>
> > Hello everyone, I am facing a problem with the function gsn_add_text. In<br>
> > the<br>
> > description of the function, it is mentioned that no missing values will be<br>
> > plotted:<br>
> ><br>
> > &#8220;This function attaches a list of text strings to the given plot.<br>
> > The text<br>
> > strings will be drawn only when the plot is drawn. If a missing value is<br>
> > encountered in the text strings or x/y values, then no text string will be<br>
> > drawn at this pair.&#8221;<br>
> ><br>
> > My script reads a netCDF file with 3 variables t2(lat,lon), lat(lat),<br>
> > lon(lon),<br>
> > so in order to attach values on the plot using this function, I have to<br>
> > make<br>
> > new 2-D variables for lat/lon and define the string to be plotted on the<br>
> > map.<br>
> > Values are assigned just fine on the plot, over the land, but missing<br>
> > values<br>
> > are also printed over the sea. I tried to use landsea masking but my data<br>
> > have<br>
> > high horizontal resolution (5km). Any suggestions?<br>
> ><br>
> > I have the same problem with WRF data, with already 2-D lat/lon arrays.<br>
> ><br>
> > This is the part of the code which prints the values:<br>
> > .<br>
> > .<br>
> > .<br>
> > contour = gsn_csm_contour_map(wks,t2,<wbr>res)<br>
> ><br>
> > t2@missing_value = -1<br>
> > t2@_FillValue = -1<br>
> > (default missing values = -999)<br>
> ><br>
> > lat2 = new(dimsizes(t2),typeof(lat),-<wbr>1)<br>
> > lon2 = new(dimsizes(t2),typeof(lon),-<wbr>1)<br>
> ><br>
> > nb = dimsizes(t2)<br>
> ><br>
> > do nl=0,nb(0)-1,1<br>
> > do ml=0,nb(1)-1,1<br>
> ><br>
> > lat2(nl,ml) = lat(nl)<br>
> > lon2(nl,ml) = lon(ml)<br>
> ><br>
> > end do<br>
> > end do<br>
> ><br>
> > points = sprintf("%3.0f", t2)<br>
> > ;points = ""+t2(:,:)+""<br>
> ><br>
> > values = gsn_add_text(wks,contour,<wbr>points,lon2(:,:),lat2(:,:),<wbr>True)<br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Stavros NTAFIS (DAFIS)<br>
> > ------------------------------<wbr>-----------------<br>
> > Physicist - Meteorologist, M.Sc.<br>
> > Research Associate, National Observatory of Athens<br>
> > (+33)9 81 94 22 12, Mobile: +30 697 04 20 242<br>
> > ---------------<br>
> > Weather charts:<br>
> > <a href="http://www.meteo.gr" rel="noreferrer" target="_blank">http://www.meteo.gr</a><br>
> > <a href="http://www.meteo.gr/meteomaps/" rel="noreferrer" target="_blank">http://www.meteo.gr/meteomaps/</a><br>
> ><br>
> ><br>
> ><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>
><br>
</div></div></blockquote></div><br></div>