<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Ning,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Alan&#39;s suggestion is a good one, but I would still like to look into why the default contouring in NCL is not working as expected on this data set.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can you provide the CSV files that go with this script? </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If they are not too large, you can email them to me directly.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Otherwise, you can use our ftp:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP">http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP</a><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style>Thanks,</div><div class="gmail_default" style><br></div><div class="gmail_default" style>--Mary</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 21, 2015 at 8:33 PM, Ning Li <span dir="ltr">&lt;<a href="mailto:ning.li@auckland.ac.nz" target="_blank">ning.li@auckland.ac.nz</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:Tahoma;color:#000000;font-size:10pt">Dear NCL users,<br>
I have encountered a problem relating to the plotting of contour lines.<br>
The data to be plotted is an 8 by 8 matrix that looks like this.<br>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="512">
<colgroup><col style="width:48pt" span="8" width="64"></colgroup>
<tbody>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt;width:48pt" align="right" width="64" height="20">-0.084</td>
<td style="width:48pt" align="right" width="64">-0.066</td>
<td style="width:48pt" align="right" width="64">-0.04</td>
<td style="width:48pt" align="right" width="64">0.021</td>
<td style="width:48pt" align="right" width="64">0.031</td>
<td style="width:48pt" align="right" width="64">-0.026</td>
<td style="width:48pt" align="right" width="64">-0.065</td>
<td style="width:48pt" align="right" width="64">-0.075</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.028</td>
<td align="right">0.005</td>
<td align="right">0.053</td>
<td align="right">0.177</td>
<td align="right">0.224</td>
<td align="right">0.136</td>
<td align="right">0.028</td>
<td align="right">-0.003</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.009</td>
<td align="right">0.038</td>
<td align="right">0.111</td>
<td align="right">0.266</td>
<td align="right">0.327</td>
<td align="right">0.333</td>
<td align="right">0.221</td>
<td align="right">0.101</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.049</td>
<td align="right">-0.024</td>
<td align="right">0.08</td>
<td align="right">0.184</td>
<td align="right">0.275</td>
<td align="right">0.352</td>
<td align="right">0.29</td>
<td align="right">0.152</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.046</td>
<td align="right">-0.029</td>
<td align="right">0.022</td>
<td align="right">0.082</td>
<td align="right">0.164</td>
<td align="right">0.195</td>
<td align="right">0.147</td>
<td align="right">0.127</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.002</td>
<td align="right">0.007</td>
<td align="right">-0.005</td>
<td align="right">-0.017</td>
<td align="right">-0.02</td>
<td align="right">0.006</td>
<td align="right">0.05</td>
<td align="right">0.059</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.03</td>
<td align="right">0.022</td>
<td align="right">-0.034</td>
<td align="right">-0.095</td>
<td align="right">-0.105</td>
<td align="right">-0.069</td>
<td align="right">-0.033</td>
<td align="right">-0.016</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.043</td>
<td align="right">0.035</td>
<td align="right">0.011</td>
<td align="right">-0.022</td>
<td align="right">-0.053</td>
<td align="right">-0.063</td>
<td align="right">-0.045</td>
<td align="right">-0.03</td>
</tr>
</tbody>
</table>
<br>
While the script is working fine with the &#39;cnFillOn&#39; resource set to True, erroneous contour lines<br>
are present when &#39;cnFillOn&#39; resource is set to False (please see the attached images).<br>
<b><br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot; <br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot; <br>
<br>
diri = &quot;/home/nli045/Desktop/sharedJ/Documents/data/&quot;<br>
fili = systemfunc(&quot;ls &quot; + diri + &quot;x*csv&quot;)<br>
<br>
in = asciiread(fili(0),(/8,8/),&quot;float&quot;)                    ; read the matrix from the directory<br>
<br>
wks = gsn_open_wks(&quot;png&quot;,&quot;test&quot;)<br>
colors = read_colormap_file(&quot;BlWhRe&quot;)<br>
<br>
res                              = True<br>
res@cnFillOn             = False                  ; CONTOURS WRONG!<br>
res@cnLinesOn          = True                  <br>
res@gsnAddCyclic     = False                 ; the plot is not global <br>
<br>
res@cnLevelSelectionMode    = &quot;ManualLevels&quot;    ; manual contour levels<br>
res@cnMinLevelValF                = -0.1<br>
res@cnMaxLevelValF              =  0.5<br>
res@cnLevelSpacingF             =  0.1<br>
<br>
plot = gsn_csm_contour(wks,in,res)    </b><br>
 <br>
I used R to make the plot and there is no problem. <br>
I have also used a different dataset in NCL, the errorneous contours are also present (see the circled contours in &#39;datasetB.png&#39;).<br>
<br>
I am using version 6.2.0. The system is 86-64 GNU/Linux.<br>
<br>
I wonder if anyone experienced the same problem in the past and how should it be resolved?
<br>
<br>
Any help would be great! Thank you very much!
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">Ning LI<br>
<br>
PhD candidate<br>
School of Environment<br>
The University of Auckland<br>
</div>
</div>
</div>
</div>
</div>

<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>