<div dir="ltr"><div class="gmail_default" style="font-size:small">This is a good suggestion, to use named colors. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For the record, we recommend using "cnFillPalette" in place of "gsn_define_colormap". This allows you to associated the colors directly with the contours (and hence enables you have other contour plots with their own colormaps).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here's an example that you should be able to run as-is:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">
<p class=""><font face="courier new, monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" <br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </font></p>
<p class=""><font face="courier new, monospace">begin<br> a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/<a href="http://uv300.nc">uv300.nc</a>","r")<br> u = a->U(1,:,:) ; read July zonal winds</font></p>
<p class=""><font face="courier new, monospace"> wks = gsn_open_wks("x11","ce")</font></p>
<p class=""><font face="courier new, monospace"> res = True<br> res@cnFillPalette = (/"white","black","Snow" \ <br> ,"PaleTurquoise","PaleGreen","SeaGreen3" ,"Yellow" \<br> ,"Orange","HotPink","Red","Violet", "Purple", "Brown", "Black"/) </font></p>
<p class=""><font face="courier new, monospace"> res@cnFillOn = True<br> res@cnLevelSelectionMode = "ExplicitLevels" <br> res@cnLevels = (/-12,-8,-4,0,4,6,8,10,15,20,25,30,40/)</font></p>
<p class=""><font face="courier new, monospace"> plot = gsn_csm_contour_map(wks,u,res)</font></p>
<p class=""><font face="courier new, monospace">end</font></p><p class=""><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 8:30 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"><div dir="ltr">Also:<br><pre> wks = gsn_open_wks(...)
colors = (/"white","black","Snow" \
,"PaleTurquoise","PaleGreen","SeaGreen3" ,"Yellow" \
,"Orange","HotPink","Red","Violet", "Purple", "Brown", "Black"/)
gsn_define_colormap(wks, colors) ; generate new color map
</pre><pre> res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = (/0.1,1,5,10,20,30,50,75,100,150/) ; "mm/day"
</pre><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 8:10 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">You can set:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">res@cnLevelSelectionMode = "ExplicitLevels"</div><div class="gmail_default" style="font-size:small">res@cnLevels = (/-10,-8,-6,-4,-2,0,2,4/)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">"cnLevels" can be any spacing of values that you want. They don't have to be equally spaced, but they do have to be increasing.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you need to match certain levels to certain colors in a color map, then you may want to see example "conLev_4.ncl" at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/contourLev.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/contourLev.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Nov 10, 2014 at 8:03 AM, Xi Chang <span dir="ltr"><<a href="mailto:xi.chang01@gmail.com" target="_blank">xi.chang01@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr">Hallo, Is there any way to create uneven color bar? for instence my plotting values ranging from -10 to +4, and I want to always plot 0 values as white. Thank you.<br></div>
<br></span>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>