<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12px"><div dir="ltr" id="yui_3_16_0_1_1415958949016_24748"><span id="yui_3_16_0_1_1415958949016_26019">Thank you for all the help! I am getting the desired plot now.</span></div><div id="yui_3_16_0_1_1415958949016_26020" dir="ltr"><br><span></span></div><div id="yui_3_16_0_1_1415958949016_26021" dir="ltr"><span>Cheers,</span></div><div id="yui_3_16_0_1_1415958949016_24749"> </div><div id="yui_3_16_0_1_1415958949016_24751" class="signature"><div id="yui_3_16_0_1_1415958949016_24750"><span id="yui_3_16_0_1_1415958949016_24756">Yours sincerely,</span></div><div id="yui_3_16_0_1_1415958949016_24752" style="font-weight:bold;"><span id="yui_3_16_0_1_1415958949016_26716">Snehlata Tirkey</span></div><div id="yui_3_16_0_1_1415958949016_24754"><span id="yui_3_16_0_1_1415958949016_24755">e-mail: snehlata_tirkey@yahoo.com</span></div></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12px;"> <div dir="ltr"> <font face="Arial" size="2"> On Thursday, 13 November 2014, 21:13, Dennis Shea <shea@ucar.edu> wrote:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv6751414453"><div><div dir="ltr"><div>A correction for [1]<br clear="none"><br clear="none"><pre> ; 17 colors<br clear="none"> res@cnFillPalette = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \ ; blues<br clear="none"> ,127 \ ; white [also, 0<br clear="none"> ,146,162,194,242/) ; yellow, red<br clear="none"><br clear="none"></pre><pre>should be<br clear="none"><br clear="none"> ; 17 colors<br clear="none"> res@cnFillColors = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \ ; blues<br clear="none"> ,127 \ ; white [also, 0]<br clear="none"> ,146,162,194,242/) ; yellow, red<br clear="none"></pre>========<br clear="none"><br clear="none"></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 clear="none"></div><div class="yiv6751414453yqt5987577051" id="yiv6751414453yqt64394"><div class="yiv6751414453gmail_extra"><br clear="none"><div class="yiv6751414453gmail_quote">On Thu, Nov 13, 2014 at 7:49 AM, Dennis Shea <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:shea@ucar.edu" target="_blank" href="mailto:shea@ucar.edu">shea@ucar.edu</a>></span> wrote:<br clear="none"><blockquote class="yiv6751414453gmail_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="yiv6751414453"><br clear="none"><br clear="none"> res@gsnSpreadColors = True<br clear="none"> res@gsnSpreadColorStart = -1<br clear="none"> res@gsnSpreadColorEnd = 2<br clear="none"><br clear="none"></span>===<br clear="none"></div>There are two common approaches. Both require use of the 'ExplicitLevels' <br clear="none"><br clear="none"></div><div>[1] <br clear="none"></div><div>Indexing from a specific color table. For example:<br clear="none"> <a rel="nofollow" shape="rect" target="_blank" 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 clear="none"><br clear="none"></div><div> gsn_define_colormap(wks, "BlueWhiteOrangeRed") ; user specified<br clear="none"></div><div><pre> res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = fspan(-2, 1, 16) ; 16 contour levels<br clear="none"> ; 17 colors<br clear="none"> res@cnFillPalette = (/ 2,10,18,26,34,42,50,58, 66, 74, 82, 90 \ ; blues<br clear="none"> ,127 \ ; white [also, 0<br clear="none"> ,146,162,194,242/) ; yellow, red</pre>The above may not be quite what you want but it gives you the idea.<br clear="none"><br clear="none">---<br clear="none"></div><div>You can force 'white' (background color) into *any* color scheme. by using index 0 which is the<br clear="none"></div><div>background color (white)<br clear="none"></div><div><br clear="none"></div><div><br clear="none">[2] <br clear="none"></div><div>Named colors.<br clear="none"></div>The following are not the -2 to 1 @ 0.2 you mentioned. They are for unequally spaced contours<br clear="none">but you get the idea. This <br clear="none"><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 clear="none"></div></div><div class="yiv6751414453gmail_extra"><br clear="none"><div class="yiv6751414453gmail_quote"><div><div class="yiv6751414453h5">On Thu, Nov 13, 2014 at 5:43 AM, <a rel="nofollow" shape="rect" ymailto="mailto:mamadoulamine.mbaye@ucad.edu.sn" target="_blank" href="mailto:mamadoulamine.mbaye@ucad.edu.sn">mamadoulamine.mbaye@ucad.edu.sn</a> <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:mamadoulamine.mbaye@ucad.edu.sn" target="_blank" href="mailto:mamadoulamine.mbaye@ucad.edu.sn">mamadoulamine.mbaye@ucad.edu.sn</a>></span> wrote:<br clear="none"></div></div><blockquote class="yiv6751414453gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="yiv6751414453h5">
<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri, Arial, Helvetica, sans-serif;">
<div>Hi Tirkey,</div>
<div>You can use res@cnFillColors = (/put the numbers corresponding of the desired color:</div>
<div><a rel="nofollow" shape="rect" target="_blank" href="https://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueWhiteOrangeRed.shtml">https://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueWhiteOrangeRed.shtml</a> /)</div>
<div>Each color should has a number</div>
<div>Hope this helps!</div>
<div>Mamadou,</div>
<div>Regards<br clear="none">
</div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
<div style="color:rgb(33,33,33);">
<hr style="display:inline-block;width:98%;">
<div dir="ltr"><font style="font-size:11pt;" color="#000000" face="Calibri, sans-serif"><b>De :</b> <a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk-bounces@ucar.edu" target="_blank" href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> <<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk-bounces@ucar.edu" target="_blank" href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a>> de la part de snehlata Tirkey <<a rel="nofollow" shape="rect" ymailto="mailto:snehlata_tirkey@yahoo.com" target="_blank" href="mailto:snehlata_tirkey@yahoo.com">snehlata_tirkey@yahoo.com</a>><br clear="none">
<b>Envoyé :</b> jeudi 13 novembre 2014 04:24<br clear="none">
<b>À :</b> <a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
<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 clear="none">
</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 clear="none">
</div>
<div dir="ltr"> wks = gsn_open_wks("ps","MSE_0.5")<br clear="none">
gsn_define_colormap(wks,"BlueWhiteOrangeRed")<br clear="none">
<br clear="none">
res = True<br clear="none">
res@gsnMaximize = True<br clear="none">
res@gsnAddCyclic = False<br clear="none">
res@cnFillOn = True<br clear="none">
res@gsnSpreadColors = True<br clear="none">
res@gsnSpreadColorStart = -1<br clear="none">
res@gsnSpreadColorEnd = 2<br clear="none">
res@trXMinF = 11<br clear="none">
res@trXMaxF = 27<br clear="none">
</div>
<div dir="ltr"><span> res@cnLevelSelectionMode = "ManualLevels"<br clear="none">
res@cnLevelSpacingF = 0.2<br clear="none">
res@cnMinLevelValF = -1<br clear="none">
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 clear="none">
</div>
<div dir="ltr">Thanking in anticipation.</div>
<div dir="ltr"><br clear="none">
</div>
</div>
<div>
<div><span>Yours sincerely,</span></div>
<div style="font-weight:bold;"><span>Snehlata Tirkey</span></div>
<div><span>e-mail: <a rel="nofollow" shape="rect" ymailto="mailto:snehlata_tirkey@yahoo.com" target="_blank" href="mailto:snehlata_tirkey@yahoo.com">snehlata_tirkey@yahoo.com</a></span></div>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
<br clear="none"></div></div>_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div>
</blockquote></div><br clear="none"></div></div></div></div><br><br></div> </div> </div> </div> </div></body></html>