<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'm not sure I fully understand what you want, but what about setting "cnFillColors" 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'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'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 "colors" array than you have contour levels, so one of the colors (color index 7, "olivedrab1") 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't need to use a "do" 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"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></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 'pixelization' 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 'resources'<br>
<br>
This lists all the resources used in all the examples.<br>
<br>
Search 'cnRasterSmoothingOn' or even partial names like<br>
'RasterSm', 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 <<a href="mailto:arne.melsom@met.no">arne.melsom@met.no</a>> wrote:<br>
> ...another thought (not sure exactly how to implement this):<br>
> You might be able to use white for all values <15 in the plot, and then redefine the color mapping and plot the color bar with the blueish colors separately.<br>
><br>
> Perhaps someone has an idea about how to make such an approach work?<br>
><br>
><br>
> ----- Original Message -----<br>
>> OK I guess that you want colors to be interpolated in one interval, but not<br>
>> in its complement (the complement being <15).<br>
>><br>
>> I'm not sure if this is possible in ncl using other plot resource options,<br>
>> the real experts will know.<br>
>><br>
>> What I guess you could do, is to regrid your array to a finer resolution<br>
>> using e.g. bilinear interpolation (see<br>
>> <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>
>> a result which has ~10x as many points in x and y), then reset values <15 to<br>
>> 0, and plot the result with e.g. res@cnFillMode = "RasterFill"<br>
>><br>
>><br>
>> ----- Original Message -----<br>
>> ><br>
>> ><br>
>> ><br>
>> > Thank you very much for your quick response Arne. It does work with<br>
>> > "CellFill" an "RasterFill"but I do not want the plot to be pixelated<br>
>> > (attached png). Hopefully there is another way to avoid the extra colors<br>
>> > and keep the same quality.<br>
>> ><br>
>> ><br>
>> ><br>
>> > Paraskevi Giannakaki , PhD student<br>
>> > Climate impact group,<br>
>> > Institute of Geography, University of Bern<br>
>> > Hallerstrasse 12, 5th floor<br>
>> > CH-3012 Bern<br>
>> > Mail: <a href="mailto:paraskevi.giannakaki@giub.unibe.ch">paraskevi.giannakaki@giub.unibe.ch</a><br>
>> > ________________________________________<br>
>> > Von: Arne Melsom [<a href="mailto:arne.melsom@met.no">arne.melsom@met.no</a>]<br>
>> > Gesendet: Montag, 7. September 2015 13:21<br>
>> > An: Giannakaki, Paraskevi (GIUB)<br>
>> > Cc: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>> > Betreff: Re: [ncl-talk] WG: extra colors around plotted objects<br>
>> ><br>
>> > Hi Paraskevi,<br>
>> > Not sure if it helps, but perhaps try including<br>
>> > res@cnFillMode = "RasterFill"<br>
>> > or<br>
>> > res@cnFillMode = "CellFill"<br>
>> > Regards,<br>
>> > Arne<br>
>> ><br>
>> > ----- Original Message -----<br>
>> > ><br>
>> > ><br>
>> > > Dear all,<br>
>> > ><br>
>> > > I want to make a plot using a threshold of 15 (so everything less than 15<br>
>> > > is<br>
>> > > equal to zero). When I make the plots, around the fileds which survive<br>
>> > > the<br>
>> > > thresholding process there are colors of the colormap which has to do<br>
>> > > with<br>
>> > > values less than 15. In the example I send you (GRADPV.png), there are<br>
>> > > blue<br>
>> > > and skyblue contours around my fields which should not be there. I want<br>
>> > > to<br>
>> > > keep the entire color-table, so I do not want to change my color scale to<br>
>> > > start from 15. Any ideas about what's wrong with the plots and how can I<br>
>> > > fix<br>
>> > > this?? You will find enclosed my ncl script and the file I used for the<br>
>> > > plot.<br>
>> > ><br>
>> > > Thank you very much in advance for your help!<br>
>> > ><br>
>> > ><br>
>> > ><br>
>> > > Paraskevi Giannakaki , PhD<br>
>> > > Climate impact group,<br>
>> > > Institute of Geography, University of Bern<br>
>> > > Hallerstrasse 12, 5th floor<br>
>> > > CH-3012 Bern<br>
>> > > Mail: <a href="mailto:paraskevi.giannakaki@giub.unibe.ch">paraskevi.giannakaki@giub.unibe.ch</a><br>
>> > ><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>
>> > ><br>
>> ><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>
>> ><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>
>><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>
_______________________________________________<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>