<div dir="ltr"><div><div>These are not appropriate for what you want to do. Remove them.<br><br> res@gsnSpreadColors = True<br> res@gsnSpreadColorStart = -1<br> res@gsnSpreadColorEnd = 2<br><br>===<br></div>There are two common approaches. Both require use of the 'ExplicitLevels' <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">http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml#White-in-the-middle</a><br><br></div><div> gsn_define_colormap(wks, "BlueWhiteOrangeRed") ; user specified<br></div><div><pre> res@cnLevelSelectionMode = "ExplicitLevels"
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 'white' (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 = "ExplicitLevels"
res@cnLevels = (/0.1,1,2.5,5,10,15,20,25,50,75/) ; ; 10 contour values
res@cnFillPalette = (/"Snow","PaleTurquoise","PaleGreen"\ ; 11 contour colors
,"SeaGreen3" ,"Yellow","Orange" \
,"HotPink","Orange","HotPink","Red"\
,"Violet", "Purple", "Brown" /) </pre><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 5:43 AM, <a href="mailto:mamadoulamine.mbaye@ucad.edu.sn">mamadoulamine.mbaye@ucad.edu.sn</a> <span dir="ltr"><<a href="mailto:mamadoulamine.mbaye@ucad.edu.sn" target="_blank">mamadoulamine.mbaye@ucad.edu.sn</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 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> <<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>> de la part de snehlata Tirkey <<a href="mailto:snehlata_tirkey@yahoo.com" target="_blank">snehlata_tirkey@yahoo.com</a>><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 class="h5">
<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("ps","MSE_0.5")<br>
gsn_define_colormap(wks,"BlueWhiteOrangeRed")<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 = "ManualLevels"<br>
res@cnLevelSpacingF = 0.2<br>
res@cnMinLevelValF = -1<br>
res@cnMaxLevelValF = 2</span></div>
<div>
<div> </div>
<div dir="ltr">I want '0' 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>_______________________________________________<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>