<div dir="ltr">Hi:<div><br></div><div>Do you really want to include the &lt; 0 part of your color bar?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 2, 2017 at 2:51 PM, Michael Weston <span dir="ltr">&lt;<a href="mailto:mjweston@masdar.ac.ae" target="_blank">mjweston@masdar.ac.ae</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div 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>
    &quot;How to coincide zero with the white color of the colo bar with
    uneven numbering&quot;<br>
    <a class="m_2480953898124925383moz-txt-link-freetext" href="http://mailman.ucar.edu/pipermail/ncl-talk/2014-November/001361.html" target="_blank">http://mailman.ucar.edu/<wbr>pipermail/ncl-talk/2014-<wbr>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="m_2480953898124925383moz-txt-link-freetext" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/get_color_index.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>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,&quot;r&quot;)<br>
        TMP       = sfile-&gt;var_index<br>
        TMP = where(TMP.ne.0,TMP,TMP@_<wbr>FillValue) ;MAKE ZERO MISSING<br>
    <br>
        res@cnFillOn          = True<br>
        res@cnFillMode       = &quot;RasterFill&quot;       ; Raster Mode<br>
        res@cnConstFEnableFill = True<br>
        res@cnLinesOn         = False<br>
        res@cnLineLabelsOn    = False<br>
    <br>
        res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;<br>
        res@cnLevels             = fspan(0,1,10)<br>
        cmap = read_colormap_file(&quot;<wbr>BlueYellowRed&quot;)<br>
        res@lbLabelBarOn          = True<br>
        res@lbLabelStrings        =
    (/&quot;0&quot;,&quot;0.1&quot;,&quot;0.2&quot;,&quot;0.3&quot;,&quot;0.4&quot;,<wbr>&quot;0.5&quot;,&quot;0.6&quot;,&quot;0.7&quot;,&quot;0.8&quot;,&quot;0.9&quot;,<wbr>&quot;1&quot;/)<br>
        res@lbOrientation         = &quot;Vertical&quot;<br>
        wks = gsn_open_wks(&quot;png&quot;,&quot;ncl_map&quot;)<br>
        plot = gsn_csm_contour_map(wks,TMP,<wbr>res)<br>
        draw(plot)<br>
        frame(wks)<br>
        delete(wks)<br>
    <br>
    <div class="m_2480953898124925383moz-signature">-- <br>
      
      
      <br>
      <div class="m_2480953898124925383moz-signature">
        <div class="m_2480953898124925383moz-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:&quot;Arial&quot;,sans-serif">A
            Part of Khalifa University of Science and Technology<span style="color:#1f497d"><u></u><u></u></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   <a href="tel:+971%202%20810%209510" value="+97128109510" target="_blank">+971 2 810 9510</a></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="m_2480953898124925383moz-txt-link-abbreviated" href="mailto:info@masdar.ae" target="_blank">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>
  </div>

<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>