<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>R: [ncl-talk] Plot of constant values</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Thank you! You suggested me the right solution. It works now and I can obtain what I need.<BR>
<BR>
Raffaele<BR>
<BR>
<BR>
-----Messaggio originale-----<BR>
Da: Alan Brammer [<A HREF="mailto:abrammer@albany.edu">mailto:abrammer@albany.edu</A>]<BR>
Inviato: mer 12/11/2014 15.32<BR>
A: Raffaele Quarta<BR>
Cc: ncl-talk@ucar.edu<BR>
Oggetto: Re: [ncl-talk] Plot of constant values<BR>
<BR>
It'll take someone with knowledge on the background plotting code to say<BR>
more, but I think you're running into an issue of trying to contour a<BR>
region over only ~4 data points.&nbsp; Looks like AreaFill needs more than 4<BR>
data points to calculate the contours. There should probably be an error<BR>
check here.<BR>
<BR>
If you change the cnFillMode&nbsp; to CellFill or RasterFill then it'll plot as<BR>
expected.&nbsp; Or expand your region to include more than 4 data points.<BR>
<BR>
cnFillMode = &quot;RasterFill&quot;<BR>
cnRasterSmoothingOn = True<BR>
<BR>
The combination of those two resources will produce contours that are very<BR>
similar to AreaFill.<BR>
<BR>
<BR>
~Alan<BR>
<BR>
On Wed, Nov 12, 2014 at 8:46 AM, Raffaele Quarta &lt;raffaele.quarta@linksmt.it<BR>
&gt; wrote:<BR>
<BR>
&gt;&nbsp; Ok, sorry if I got wrong since I called functions instead of resources.<BR>
&gt; I'm trying to make a plot of NetCDF file, by using a tiling approach and<BR>
&gt; making a subset of the data.<BR>
&gt; Although I add the following two lines in my script, as you suggested, I<BR>
&gt; can't obtain what I'd like to.<BR>
&gt;<BR>
&gt; --------------------------------<BR>
&gt; res@cnConstFEnableFill = True&nbsp;&nbsp; |<BR>
&gt; res@cnConstFLabelOn = False&nbsp;&nbsp;&nbsp;&nbsp; |<BR>
&gt; --------------------------------<BR>
&gt;<BR>
&gt; Attached you will find:<BR>
&gt;<BR>
&gt; - file_input_crop.nc (NETCDF input file that I'm using)<BR>
&gt; - tms_output.png (an example of output .PNG that I got)<BR>
&gt; - tms_test.ncl (the script that I'm using for the plot)<BR>
&gt;<BR>
&gt; Looking at the output, I believe that NCL isn't able to get the constant<BR>
&gt; value in the selected bounding area.<BR>
&gt;<BR>
&gt; Maybe I'm not using appropriately the resources.<BR>
&gt;<BR>
&gt; Thank you for the help<BR>
&gt;<BR>
&gt; Raffaele<BR>
&gt;<BR>
&gt; -----Original Message-----<BR>
&gt; From: Alan Brammer [<A HREF="mailto:abrammer@albany.edu">mailto:abrammer@albany.edu</A> &lt;abrammer@albany.edu&gt;]<BR>
&gt; Sent: Tue 11/11/2014 6:08 PM<BR>
&gt; To: Raffaele Quarta<BR>
&gt; Cc: ncl-talk@ucar.edu<BR>
&gt; Subject: Re: [ncl-talk] Plot of constant values<BR>
&gt;<BR>
&gt; It'll help everyone solve this by describing how it is not working?&nbsp; Also<BR>
&gt; fyi these are resources not functions.<BR>
&gt;<BR>
&gt;<BR>
&gt; This works exactly as expected for me in 6.2.0 and 6.2.1.<BR>
&gt;<BR>
&gt;<BR>
&gt; x = new ( (/100,100/), float)<BR>
&gt; x = 100<BR>
&gt;<BR>
&gt; wks = gsn_open_wks(&quot;X11&quot;,&quot;ConstFill_wks&quot;)<BR>
&gt;<BR>
&gt; res = True<BR>
&gt; res@cnFillOn = True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;;;&nbsp; The contour needs to be filled<BR>
&gt; to<BR>
&gt; start with, for a constant value to be filled.<BR>
&gt; res@cnConstFEnableFill = True<BR>
&gt; res@cnConstFLabelOn = False<BR>
&gt;<BR>
&gt; plot = gsn_csm_contour(wks, x, res)<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; Alan Brammer<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; On Tue, Nov 11, 2014 at 11:29 AM, Raffaele Quarta &lt;<BR>
&gt; raffaele.quarta@linksmt.it&gt; wrote:<BR>
&gt;<BR>
&gt; &gt;&nbsp; Hi,<BR>
&gt; &gt;<BR>
&gt; &gt; I'm using the 6.2.0 NCL version. Actually, I'm dealing with the problem<BR>
&gt; to<BR>
&gt; &gt; plot an area with constant value.<BR>
&gt; &gt; I saw that starting from the version 6.2.0, the following function is<BR>
&gt; able<BR>
&gt; &gt; to solve the problem.<BR>
&gt; &gt;<BR>
&gt; &gt; -------------------------<BR>
&gt; &gt; cnConstFEnableFill<BR>
&gt; &gt;<BR>
&gt; &gt; Available in version 6.2.0 and later.<BR>
&gt; &gt; If the boolean resource cnConstFEnableFill is set to True, then in most<BR>
&gt; &gt; cases, constant or near-constant fields will be rendered as a filled<BR>
&gt; area,<BR>
&gt; &gt; rather than having the contoured area remain blank. By default, the<BR>
&gt; &gt; constant field informational text box will still appear; turn it off by<BR>
&gt; &gt; setting cnConstFLabelOn to False.<BR>
&gt; &gt;<BR>
&gt; &gt; In the future, cnConstFEnableFill will likely default to True, with<BR>
&gt; &gt; cnConstFLabelOn defaulting to False unless contour line drawing is<BR>
&gt; enabled.<BR>
&gt; &gt;<BR>
&gt; &gt; Default: False<BR>
&gt; &gt; -----------------------<BR>
&gt; &gt;<BR>
&gt; &gt; I tried to use this solution but it seems not working. Maybe it a bug of<BR>
&gt; &gt; the software?<BR>
&gt; &gt; Can you suggest a different solution?<BR>
&gt; &gt;<BR>
&gt; &gt; Thank you very much.<BR>
&gt; &gt;<BR>
&gt; &gt; Raffaele<BR>
&gt; &gt;<BR>
&gt; &gt; --<BR>
&gt; &gt; This email was Virus checked by Astaro Security Gateway.<BR>
&gt; <A HREF="http://www.sophos.com">http://www.sophos.com</A><BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; _______________________________________________<BR>
&gt; &gt; ncl-talk mailing list<BR>
&gt; &gt; List instructions, subscriber options, unsubscribe:<BR>
&gt; &gt; <A HREF="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</A><BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt;<BR>
&gt; --<BR>
&gt; This email was Virus checked by Astaro Security Gateway.<BR>
&gt; <A HREF="http://www.sophos.com">http://www.sophos.com</A><BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
<BR>
--<BR>
This email was Virus checked by Astaro Security Gateway. <A HREF="http://www.sophos.com">http://www.sophos.com</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>