<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear NCL users,<br>
<br>
This question has been asked many times. However, I wonder if a more
elegant solution has been found in the mean time.<br>
E.g subjects in this group, but these do not answer my question<br>
<br>
Making zero value white in contour plot (Jake Huff)<br>
Re: Making zero value white in contour plot (Mary Haley)<br>
Re: Making zero value white in contour plot (Dennis Shea)<br>
<br>
I have also tried:<br>
Getting the colour index (<i>get_color_index</i>), setting the
colour index to another colour using <i>NhlSetColor</i><i><br>
</i><br>
I have tried these links<br>
"How to coincide zero with the white color of the colo bar with
uneven numbering"<br>
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/pipermail/ncl-talk/2014-November/001361.html">http://mailman.ucar.edu/pipermail/ncl-talk/2014-November/001361.html</a>
<br>
This involves indexing a 256 color palette to the colours you want
in your 16 level map/color bar. <br>
<br>
combined with <br>
<br>
<a class="moz-txt-link-freetext" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/get_color_index.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/get_color_index.shtml</a><br>
<br>
However, none have really hit the nail on the head despite my
efforts. And I imagine this must be much simpler than indexing a 256
color scheme.<br>
<br>
What I want: <br>
1. I want to make a map using filled contours, but I want zero to be
represented by white.<br>
I can achieve this by making all zero values missing values.<br>
2. I want to have a color bar next to my map, with zero represented
by white.<br>
I can not achieve this.<br>
<br>
My map is attached.<br>
As you can see it is beautiful, except, I would like to get rid of
the delightful purple and dark blue in the color bar. (i.e. first
two classes.)<br>
<br>
Is this possible?<br>
<br>
Thanks and regards<br>
Michael<br>
<br>
<br>
general overview of code below<br>
<br>
sfile = addfile(srcFileName,"r")<br>
TMP = sfile->var_index<br>
TMP = where(TMP.ne.0,TMP,TMP@_FillValue) ;MAKE ZERO MISSING<br>
<br>
res@cnFillOn = True<br>
res@cnFillMode = "RasterFill" ; Raster Mode<br>
res@cnConstFEnableFill = True<br>
res@cnLinesOn = False<br>
res@cnLineLabelsOn = False<br>
<br>
res@cnLevelSelectionMode = "ExplicitLevels"<br>
res@cnLevels = fspan(0,1,10)<br>
cmap = read_colormap_file("BlueYellowRed")<br>
res@lbLabelBarOn = True<br>
res@lbLabelStrings =
(/"0","0.1","0.2","0.3","0.4","0.5","0.6","0.7","0.8","0.9","1"/)<br>
res@lbOrientation = "Vertical"<br>
wks = gsn_open_wks("png","ncl_map")<br>
plot = gsn_csm_contour_map(wks,TMP,res)<br>
draw(plot)<br>
frame(wks)<br>
delete(wks)<br>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<br>
<div class="moz-signature">
<div class="moz-signature"><b>Michael</b><font
face="Arial,sans-serif" color="#1F497D"><b> </b></font><font
face="Arial,sans-serif" color="black"><b>Weston</b></font><font
face="Arial,sans-serif" color="black"><b><br>
</b></font><font face="Arial,sans-serif" color="black"
size="2"><span style="font-size:10pt;">Research Engineer </span></font></div>
<img alt="" src="cid:part1.B4D67818.344DCF09@masdar.ac.ae"
height="57" width="339"><br>
<br>
<b><span
style="font-size:10.0pt;font-family:"Arial",sans-serif">A
Part of Khalifa University of Science and Technology<span
style="color:#1F497D"><o:p></o:p></span></span></b>
<p class="MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal">
</p>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"><font face="Arial,sans-serif"
color="#0391BE" size="2"><span style="font-size:10pt;">PO
Box 54224, Abu Dhabi, </span></font><font
face="Arial,sans-serif" color="#0391BE" size="2"><span
style="font-size:10pt;"><br>
United Arab Emirates</span></font><font
face="Arial,sans-serif" color="#0391BE" size="2"><span
style="font-size:10pt;"><br>
Office +971 2 810 9510</span></font></span></font></div>
<font face="Arial,sans-serif" color="#0391BE" size="2"><span
style="font-size:10pt;"><br>
</span></font>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"><font face="Arial,sans-serif"
color="#0391BE" size="2"><span style="font-size:10pt;">Email </span></font><a
href="mailto:mjweston@masdar.ac.ae" target="_blank"><font
face="Times New Roman,serif">mjweston@masdar.ac.ae</font></a><font
face="Times New Roman,serif" color="#0391BE"> </font><font
face="Times New Roman,serif" color="black"> </font><font
face="Arial,sans-serif" color="#0391BE" size="2"><span
style="font-size:10pt;"></span></font></span></font></div>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"><font color="black"> </font><a
href="http://www.masdar.ac.ae/" target="_blank"><font
face="Arial,sans-serif" size="2"><span
style="font-size:10pt;">http://www.masdar.ac.ae</span></font></a></span></font></div>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"><font face="Times New Roman,serif"
color="black" size="3"><span style="font-size:12pt;"><b> </b></span></font></span></font></div>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"> </span></font></div>
<div style="margin:0;"><font face="Calibri,sans-serif" size="2"><span
style="font-size:11pt;"><font face="Webdings"
color="#0099FF" size="2"><span style="font-size:10pt;"></span></font><font
color="#0099FF" size="2"><span style="font-size:10pt;">
</span></font><font face="Arial,sans-serif"
color="#0099FF" size="1"><span style="font-size:8pt;"><i>Please
consider the environment before printing this email</i></span></font><font
face="Arial,sans-serif" color="#0099FF" size="1"><span
style="font-size:8pt;"><i><br>
</i></span></font><font face="Arial,sans-serif"
color="#0099FF" size="1"><span style="font-size:8pt;"><br>
This transmission is confidential and intended solely
for the person or organization to whom it is
addressed. It may contain privileged and confidential
information. If you are not the intended recipient,
you should not copy, distribute or take any action in
reliance on it. If you have received this transmission
in error, please notify us immediately by e-mail at </span></font><font
face="Arial,sans-serif" size="1"><span
style="font-size:8pt;"><b><font color="#0099FF"><a class="moz-txt-link-abbreviated" href="mailto:info@masdar.ae">info@masdar.ae</a></font></b></span></font><font
face="Arial,sans-serif" color="#0099FF" size="1"><span
style="font-size:8pt;"><b>.</b> </span></font></span></font></div>
</div>
</div>
</body>
</html>