<div dir="ltr"><div>A correction for [1]<br><br><pre>                                               ; 17 colors<br>  res@cnFillPalette        = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \    ; blues<br>                              ,127 \             ; white [also, 0<br>                              ,146,162,194,242/) ; yellow, red<br><br></pre><pre>should be<br><br>                                                 ; 17 colors<br>  res@cnFillColors        = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \    ; blues<br>                              ,127 \             ; white [also, 0]<br>                              ,146,162,194,242/) ; yellow, red<br></pre>========<br><br></div>Also, can can repeat index values. so -0.2, 0.0, 0.2  could be referenced to 127, 127,127   [or, 0,0,0]<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 7:49 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"><div dir="ltr"><div><div>These are not appropriate for what you want to do. Remove them.<span class=""><br><br>  res@gsnSpreadColors  =  True<br>  res@gsnSpreadColorStart = -1<br>  res@gsnSpreadColorEnd  = 2<br><br></span>===<br></div>There are two common approaches. Both require use of the &#39;ExplicitLevels&#39; <br><br></div><div>[1] <br></div><div>Indexing from a specific color table. For example:<br>   <a href="http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml#White-in-the-middle" target="_blank">http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml#White-in-the-middle</a><br><br></div><div>   gsn_define_colormap(wks, &quot;BlueWhiteOrangeRed&quot;)        ; user specified<br></div><div><pre>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;              
  res@cnLevels             = fspan(-2, 1, 16)    ; 16 contour levels<br>                                                 ; 17 colors<br>  res@cnFillPalette        = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \    ; blues<br>                              ,127 \             ; white [also, 0<br>                              ,146,162,194,242/) ; yellow, red</pre>The above may not be quite what you want but it gives you the idea.<br><br>---<br></div><div>You can force &#39;white&#39; (background color) into *any* color scheme. by using index 0 which is the<br></div><div>background color (white)<br></div><div><br></div><div><br>[2] <br></div><div>Named colors.<br></div>The  following are not the -2 to 1 @ 0.2 you mentioned. They are for unequally spaced contours<br>but you get the idea. This <br><div><pre>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;              
  res@cnLevels             = (/0.1,1,2.5,5,10,15,20,25,50,75/) ;   ; 10 contour values
  res@cnFillPalette        = (/&quot;Snow&quot;,&quot;PaleTurquoise&quot;,&quot;PaleGreen&quot;\ ; 11 contour colors
                              ,&quot;SeaGreen3&quot; ,&quot;Yellow&quot;,&quot;Orange&quot;    \
                              ,&quot;HotPink&quot;,&quot;Orange&quot;,&quot;HotPink&quot;,&quot;Red&quot;\
                              ,&quot;Violet&quot;, &quot;Purple&quot;, &quot;Brown&quot;       /)  </pre><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Nov 13, 2014 at 5:43 AM, <a href="mailto:mamadoulamine.mbaye@ucad.edu.sn" target="_blank">mamadoulamine.mbaye@ucad.edu.sn</a> <span dir="ltr">&lt;<a href="mailto:mamadoulamine.mbaye@ucad.edu.sn" target="_blank">mamadoulamine.mbaye@ucad.edu.sn</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">




<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Tirkey,</p>
<p>You can use   res@cnFillColors   = (/put the numbers corresponding of the desired color:</p>
<p><a href="https://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueWhiteOrangeRed.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueWhiteOrangeRed.shtml</a> /)</p>
<p>Each color should has a number</p>
<p>Hope this helps!</p>
<p>Mamadou,</p>
<p>Regards<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De :</b> <a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> &lt;<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>&gt; de la part de snehlata Tirkey &lt;<a href="mailto:snehlata_tirkey@yahoo.com" target="_blank">snehlata_tirkey@yahoo.com</a>&gt;<br>
<b>Envoyé :</b> jeudi 13 novembre 2014 04:24<br>
<b>À :</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Objet :</b> [ncl-talk] How to coincide zero with the white color of the colo bar with uneven numbering</font>
<div> </div>
</div><div><div>
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:12px">
<div dir="ltr"><span>Hello NCL users,</span></div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><span>I am trying to plot a color plot with a color bar of range -1 to 2 with an interval of 0.2 by using-</span></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">  wks = gsn_open_wks(&quot;ps&quot;,&quot;MSE_0.5&quot;)<br>
  gsn_define_colormap(wks,&quot;BlueWhiteOrangeRed&quot;)<br>
  <br>
  res               =  True<br>
  res@gsnMaximize      =  True<br>
  res@gsnAddCyclic     =  False<br>
  res@cnFillOn           =  True<br>
  res@gsnSpreadColors  =  True<br>
  res@gsnSpreadColorStart = -1<br>
  res@gsnSpreadColorEnd  = 2<br>
  res@trXMinF        = 11<br>
  res@trXMaxF        = 27<br>
</div>
<div dir="ltr"><span> res@cnLevelSelectionMode =  &quot;ManualLevels&quot;<br>
  res@cnLevelSpacingF    = 0.2<br>
  res@cnMinLevelValF   =  -1<br>
  res@cnMaxLevelValF    = 2</span></div>
<div>
<div> </div>
<div dir="ltr">I want &#39;0&#39; to coincide with the white of the bar but it is coinciding with the yellow. Please help.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Thanking in anticipation.</div>
<div dir="ltr"><br>
</div>
</div>
<div>
<div><span>Yours sincerely,</span></div>
<div style="font-weight:bold"><span>Snehlata Tirkey</span></div>
<div><span>e-mail: <a href="mailto:snehlata_tirkey@yahoo.com" target="_blank">snehlata_tirkey@yahoo.com</a></span></div>
</div>
</div>
</div>
</div></div></div>
</div>
</div>

<br></div></div>_______________________________________________<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>
</blockquote></div><br></div>