<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Times New Roman;color: #000000;font-size: 12pt;">
Hi Alan,&nbsp;
<div><br>
</div>
<div>Thanks for the instructions. I will read both.</div>
<div><br>
</div>
<div>Lifen
<div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div>
<div>
<p class="MsoNormal"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<div id="divRpF279518" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b><br>
</b></font></div>
<div id="divRpF279518" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Alan Brammer [abrammer@albany.edu]<br>
<b>Sent:</b> Wednesday, March 04, 2015 1:15 PM<br>
<b>To:</b> Jiang, Lifen<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] White for zero in a map<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>Please read the two links below.&nbsp; You have to define the coordinates of the data, as detailed in the first link.&nbsp; Then overlay the contours on the map, can be done through the function in the 2nd link.&nbsp;</div>
<div><br>
</div>
<div><a href="https://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml</a><br>
</div>
<div><br>
</div>
<a href="https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour_map.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour_map.shtml</a>
<div><br>
</div>
<div>Good luck. &nbsp;<br>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Mar 4, 2015 at 12:41 PM, Jiang, Lifen <span dir="ltr">
&lt;<a href="mailto:lfjiang@ou.edu" target="_blank">lfjiang@ou.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>
<div style="direction:ltr; font-family:Times New Roman; color:#000000; font-size:12pt">
Hi Dennis, Rick and Mary,
<div><br>
</div>
<div>Sorry, I was using 6.0.0. I ran it aagin in 6.2.1 and got a figure like in &quot;Plot_Diff&quot;. But I would like to see a figure like in &quot;Map&quot;. Could you please give me more help?</div>
<div><br>
</div>
<div>
<div>Thank you for telling me my mistake.</div>
<div><br>
</div>
<div>Lifen<br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div>
<div>
<p class="MsoNormal"><span style="color:#a7bce3">______________________________</span></p>
<p class="MsoNormal" style="margin:0in 0in 0pt; font-family:'Times New Roman'; background-color:rgb(255,255,255); text-align:justify">
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<div style="direction:ltr"><font face="Tahoma" color="#000000"><b>From:</b> Dennis Shea [<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>]<br>
<b>Sent:</b> Wednesday, March 04, 2015 10:48 AM<br>
<b>To:</b> Jiang, Lifen<br>
<b>Cc:</b> Mary Haley; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
<div>
<div class="h5"><br>
<b>Subject:</b> Re: [ncl-talk] White for zero in a map<br>
</div>
</div>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">
<div>What version of NCL are you using?<br>
<br>
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/span_color_indexes.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/span_color_indexes.shtml</a><br>
<br>
</div>
indicates that&nbsp; this function is &quot;<i>Available in <a href="https://www.ncl.ucar.edu/prev_releases.shtml#6.2.0" target="_blank">
version 6.2.0</a> and later.&quot;<br>
<br>
<br>
</i></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Mar 4, 2015 at 9:38 AM, Jiang, Lifen <span dir="ltr">
&lt;<a href="mailto:lfjiang@ou.edu" target="_blank">lfjiang@ou.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>
<div style="direction:ltr; font-family:Times New Roman; color:#000000; font-size:12pt">
Hi Mary,
<div><br>
</div>
<div>Thank you very much for writing the script for me! But it showed below error when I ran it. I have attached the script and my data file again. It will be helpful if you or anybody else can help tell the problem.</div>
<div><br>
</div>
<div><span style="font-size:12pt">fatal:Undefined identifier: (span_color_indexes) is undefined, can't continue</span></div>
<div>
<div>fatal:Execute: Error occurred at or near line 23 in file diff_test.ncl</div>
<div><br>
</div>
<div>Thanks again,</div>
<div><br>
</div>
<div>Lifen&nbsp;</div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div>
<div>
<p class="MsoNormal"><span style="color:#a7bce3">______________________________</span></p>
<p class="MsoNormal" style="margin:0in 0in 0pt; font-family:'Times New Roman'; background-color:rgb(255,255,255); text-align:justify">
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<div style="direction:ltr"><font face="Tahoma" color="#000000"><b>From:</b> Mary Haley [<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>]<br>
<b>Sent:</b> Tuesday, March 03, 2015 3:29 PM<br>
<b>To:</b> Jiang, Lifen<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] White for zero in a map<br>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">There are many ways you can do this.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I've attached a script that does this by using the cnFillColors resource to specify a list of color indexes into the &quot;rainbow&quot; color map, but then I changed the color index that represents level 0.0 to be 0
 (the background color, and therefore white).</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">--Mary</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Mar 1, 2015 at 3:01 PM, Jiang, Lifen <span dir="ltr">
&lt;<a href="mailto:lfjiang@ou.edu" target="_blank">lfjiang@ou.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>
<div style="direction:ltr; font-family:Times New Roman; color:#000000; font-size:12pt">
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<div>
<div class="gmail_extra">Hello, </div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">I was trying to create a map of the attached variable. The min and and max are -14 and 18, respectively.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">I would like to set white for zero, but could not work out how to make it. Script is at the end of this email.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Could anybody help with my issue?</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">I appreciate your time and help!</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Thanks,</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Lifen</div>
<div class="gmail_extra"><br>
</div>
<p><span style="font-family:&#23435;&#20307;">;************************************************<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;&nbsp;&nbsp; <br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;&nbsp; <br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;&nbsp; <br>
<br>
begin<br>
<br>
&nbsp; in = addfile(&quot;Diff.nc&quot;,&quot;r&quot;)<br>
&nbsp; t&nbsp; = in-&gt;Diff<br>
&nbsp; t@_FillValue&nbsp; = -999<br>
&nbsp; t@missing_value = t@_FillValue<br>
<br>
&nbsp; printVarSummary(t)<br>
<br>
&nbsp; wks = gsn_open_wks(&quot;png&quot; ,&quot;Plot_Diff&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; <br>
&nbsp; gsn_define_colormap(wks,&quot;rainbow&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; choose colormap<br>
<br>
&nbsp; res&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;= True&nbsp;&nbsp;&nbsp;&nbsp; ; plot mods desired<br>
<br>
&nbsp; res@cnFillOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True&nbsp;&nbsp;&nbsp;&nbsp; ; turn on color fill<br>
&nbsp; res@cnLinesOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False&nbsp;&nbsp;&nbsp; ; turn off contour lines<br>
&nbsp; res@cnLevelSpacingF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; contour spacing<br>
<br>
;---This resource not needed in NCL V6.1.0<br>
&nbsp; res@gsnSpreadColors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True&nbsp;&nbsp;&nbsp;&nbsp; ; use full range of color map<br>
<br>
&nbsp; res@lbLabelStride&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1<br>
<br>
&nbsp; res@pmTickMarkDisplayMode = &quot;Always&quot;; use NCL default lat/lon labels<br>
<br>
&nbsp; res@gsnAddCyclic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False&nbsp;&nbsp;&nbsp; ; data already has cyclic point<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;; this must also be set for any zoom<br>
<br>
; note that the gsn_csm_*map_ce templates automatically set <br>
; res@mpLimitMode=&quot;LatLon&quot; for you. If you are plotting a different projection,<br>
; you may have to set this resource.<br>
<br>
&nbsp; res@mpMinLatF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -90&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; range to zoom in on<br>
&nbsp; res@mpMaxLatF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 90<br>
&nbsp; res@mpMinLonF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -180<br>
&nbsp; res@mpMaxLonF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 180<br>
&nbsp; <br>
&nbsp; res@cnLevelSelectionMode = &quot;ManualLevels&quot;<br>
&nbsp; res@cnMinLevelValF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -15<br>
&nbsp; res@cnMaxLevelValF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 20<br>
<br>
&nbsp; plot = gsn_csm_contour_map_ce(wks,t({-90:90},{-180:180}), res)<br>
<br>
</span></p>
<div class="gmail_extra"><span style="font-family:&#23435;&#20307;">end</span>&nbsp;</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>
</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>
</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>
</div>
</div>
</div>
</div>
</div>
</body>
</html>