<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Arne,<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;m not sure I fully understand what you want, but what about setting &quot;cnFillColors&quot; so that the first four contour levels are white, but setting lbFillColors with the normal colors, so you still see the colors in the labelbar?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;ve attached two versions of your modified script that produce the exact same plot.  The second version (mod2) uses named colors in the setting of cnFillColors and lbFillColors, since you can now do this (since V6.2.0).  This way it&#39;s easier to see which colors are associated with which contour levels.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that you actually have one more color in your &quot;colors&quot; array than you have contour levels, so one of the colors (color index 7, &quot;olivedrab1&quot;) is getting skipped. In the mod2 version of the script, I just left this color out.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Finally, you don&#39;t need to use a &quot;do&quot; loop to set your data values.  You can use the where statement:</div><div class="gmail_default" style="">







<p class="" style=""><font face="monospace, monospace">data = pv1_00   ; copy metadata              <br>data = where(pv1_00.gt.15, pv1_00, 0.)</font></p><p class="" style="font-size:small"><font face="arial, helvetica, sans-serif">--Mary</font></p><p class="" style="font-size:small"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 7:39 AM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a national holiday in the USA (Labor Day).<br>
The real graphics experts are not likely to check email. Likely .... tomorrow.<br>
<br>
---<br>
<br>
To reduce &#39;pixelization&#39; when using raster mode ... try<br>
<br>
<a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnRasterSmoothingOn" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnRasterSmoothingOn</a><br>
<br>
    res@cnRasterSmoothingOn = True      ; default is False<br>
<br>
---<br>
<br>
FYI:<br>
<br>
<a href="http://www.ncl.ucar.edu/Applications/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applications/</a><br>
<br>
Under the header:   Category List of NCL Application Examples<br>
<br>
You will see<br>
       [List of tips, resources, functions/procedures and the example<br>
scripts they appear in.]<br>
<br>
Click &#39;resources&#39;<br>
<br>
This lists all the resources used in all the examples.<br>
<br>
Search &#39;cnRasterSmoothingOn&#39;     or even partial names like<br>
&#39;RasterSm&#39;, it will provide the link to the rsource *and* list all the<br>
examples where this resource is used. This allows you see the effect<br>
and, may, provide an idea of other resources that are commonly used<br>
when this option is True.<br>
<br>
Good Luck<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Sep 7, 2015 at 6:45 AM, Arne Melsom &lt;<a href="mailto:arne.melsom@met.no">arne.melsom@met.no</a>&gt; wrote:<br>
&gt; ...another thought (not sure exactly how to implement this):<br>
&gt; You might be able to use white for all values &lt;15 in the plot, and then redefine the color mapping and plot the color bar with the blueish colors separately.<br>
&gt;<br>
&gt; Perhaps someone has an idea about how to make such an approach work?<br>
&gt;<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt;&gt; OK I guess that you want colors to be interpolated in one interval, but not<br>
&gt;&gt; in its complement (the complement being &lt;15).<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m not sure if this is possible in ncl using other plot resource options,<br>
&gt;&gt; the real experts will know.<br>
&gt;&gt;<br>
&gt;&gt; What I guess you could do, is to regrid your array to a finer resolution<br>
&gt;&gt; using e.g. bilinear interpolation (see<br>
&gt;&gt; <a href="https://www.ncl.ucar.edu/Applications/regrid.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/regrid.shtml</a> for examples; perhaps use<br>
&gt;&gt; a result which has ~10x as many points in x and y), then reset values &lt;15 to<br>
&gt;&gt; 0, and plot the result with e.g. res@cnFillMode = &quot;RasterFill&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ----- Original Message -----<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thank you very much for your quick response Arne. It does work with<br>
&gt;&gt; &gt; &quot;CellFill&quot; an &quot;RasterFill&quot;but I do not want the plot to be  pixelated<br>
&gt;&gt; &gt; (attached png). Hopefully there is another way to avoid the extra colors<br>
&gt;&gt; &gt; and keep the same quality.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Paraskevi Giannakaki , PhD student<br>
&gt;&gt; &gt; Climate impact group,<br>
&gt;&gt; &gt; Institute of Geography, University of Bern<br>
&gt;&gt; &gt; Hallerstrasse 12, 5th floor<br>
&gt;&gt; &gt; CH-3012 Bern<br>
&gt;&gt; &gt; Mail: <a href="mailto:paraskevi.giannakaki@giub.unibe.ch">paraskevi.giannakaki@giub.unibe.ch</a><br>
&gt;&gt; &gt; ________________________________________<br>
&gt;&gt; &gt; Von: Arne Melsom [<a href="mailto:arne.melsom@met.no">arne.melsom@met.no</a>]<br>
&gt;&gt; &gt; Gesendet: Montag, 7. September 2015 13:21<br>
&gt;&gt; &gt; An: Giannakaki, Paraskevi (GIUB)<br>
&gt;&gt; &gt; Cc: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;&gt; &gt; Betreff: Re: [ncl-talk] WG: extra colors around plotted objects<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi Paraskevi,<br>
&gt;&gt; &gt; Not sure if it helps, but perhaps try including<br>
&gt;&gt; &gt;  res@cnFillMode = &quot;RasterFill&quot;<br>
&gt;&gt; &gt; or<br>
&gt;&gt; &gt;  res@cnFillMode = &quot;CellFill&quot;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt; Arne<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ----- Original Message -----<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Dear all,<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; I want to make a plot using a threshold of 15 (so everything less than 15<br>
&gt;&gt; &gt; &gt; is<br>
&gt;&gt; &gt; &gt; equal to zero). When I make the plots, around the fileds which survive<br>
&gt;&gt; &gt; &gt; the<br>
&gt;&gt; &gt; &gt; thresholding process there are colors of the colormap which has to do<br>
&gt;&gt; &gt; &gt; with<br>
&gt;&gt; &gt; &gt; values less than 15. In the example I send you (GRADPV.png), there are<br>
&gt;&gt; &gt; &gt; blue<br>
&gt;&gt; &gt; &gt; and skyblue contours around my fields which should not be there. I want<br>
&gt;&gt; &gt; &gt; to<br>
&gt;&gt; &gt; &gt; keep the entire color-table, so I do not want to change my color scale to<br>
&gt;&gt; &gt; &gt; start from 15. Any ideas about what&#39;s wrong with the plots and how can I<br>
&gt;&gt; &gt; &gt; fix<br>
&gt;&gt; &gt; &gt; this?? You will find enclosed my ncl script and the file I used for the<br>
&gt;&gt; &gt; &gt; plot.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Thank you very much in advance for your help!<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Paraskevi Giannakaki , PhD<br>
&gt;&gt; &gt; &gt; Climate impact group,<br>
&gt;&gt; &gt; &gt; Institute of Geography, University of Bern<br>
&gt;&gt; &gt; &gt; Hallerstrasse 12, 5th floor<br>
&gt;&gt; &gt; &gt; CH-3012 Bern<br>
&gt;&gt; &gt; &gt; Mail: <a href="mailto:paraskevi.giannakaki@giub.unibe.ch">paraskevi.giannakaki@giub.unibe.ch</a><br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; &gt; ncl-talk mailing list<br>
&gt;&gt; &gt; &gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;&gt; &gt; &gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; &gt; &gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; ncl-talk mailing list<br>
&gt;&gt; &gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;&gt; &gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; &gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
</div></div></blockquote></div><br></div>