<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 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 </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 id="divRpF683647" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Mary Haley [haley@ucar.edu]<br>
<b>Sent:</b> Tuesday, March 03, 2015 3:29 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 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 "rainbow" 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">
<<a href="mailto:lfjiang@ou.edu" target="_blank">lfjiang@ou.edu</a>></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:宋体">;************************************************<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" <br>
<br>
begin<br>
<br>
in = addfile("Diff.nc","r")<br>
t = in->Diff<br>
t@_FillValue = -999<br>
t@missing_value = t@_FillValue<br>
<br>
printVarSummary(t)<br>
<br>
wks = gsn_open_wks("png" ,"Plot_Diff") ; <br>
gsn_define_colormap(wks,"rainbow") ; choose colormap<br>
<br>
res = True ; plot mods desired<br>
<br>
res@cnFillOn = True ; turn on color fill<br>
res@cnLinesOn = False ; turn off contour lines<br>
res@cnLevelSpacingF = 3 ; contour spacing<br>
<br>
;---This resource not needed in NCL V6.1.0<br>
res@gsnSpreadColors = True ; use full range of color map<br>
<br>
res@lbLabelStride = 1<br>
<br>
res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels<br>
<br>
res@gsnAddCyclic = False ; data already has cyclic point<br>
; this must also be set for any zoom<br>
<br>
; note that the gsn_csm_*map_ce templates automatically set <br>
; res@mpLimitMode="LatLon" for you. If you are plotting a different projection,<br>
; you may have to set this resource.<br>
<br>
res@mpMinLatF = -90 ; range to zoom in on<br>
res@mpMaxLatF = 90<br>
res@mpMinLonF = -180<br>
res@mpMaxLonF = 180<br>
<br>
res@cnLevelSelectionMode = "ManualLevels"<br>
res@cnMinLevelValF = -15<br>
res@cnMaxLevelValF = 20<br>
<br>
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:宋体">end</span> </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>
</body>
</html>