<div dir="ltr"><div class="gmail_default" style="font-size:small">​There are a couple of problems.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First, you are trying to use &quot;ind&quot; on a 2D array.  &quot;ind&quot; can only be used on a 1D array.​ That is why you are getting this error:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><div style="font-size:12.8000001907349px;font-family:arial,sans-serif">fatal:Number of dimensions in parameter (0) of (ind) is (2), (1) dimensions were expected</div><div style="font-size:small"><br></div><div style="font-size:small">Second, you can&#39;t get indices into a 2D array and then plug them into 1D arrays that only represent the X or Y dimension of your data, which you appear to be attempting with:</div><div style="font-size:small"><br></div><div style><div style>    ii = ind(levels(i).le.data1.and.data1.lt.levels(i+1))</div><div style>    dum_fill(i) = gsn_add_polymarker(wks,xy,height(ii),month(ii),mkres)</div></div><div style="font-size:small"><br></div><div style="font-size:small"><br></div><div style="font-size:small">What you need to do is create 2D versions of height and month that are the same size as data1, with their values propagated across the appropriate dimensions. You then need to convert these two arrays, and data1 to 1D arrays, so you can use this with &quot;ind&quot;.  This is rather awkward, and I wish there was a better way:</div><div style="font-size:small"><br></div><div style="font-size:small">UNTESTED:</div><div style="font-size:small"><br></div><div style><div style><font face="courier new, monospace">  height_2d_as_1d = ndtooned(conform(data1,height,0))</font></div><div style><font face="courier new, monospace">  month_2d_as_1d  = ndtooned(conform(data1,month,1))</font></div><div style><font face="courier new, monospace">  data1_2d_as_1d  = ndtooned(data1)</font></div><div style><font face="courier new, monospace">  do i=0,nlevels-2</font></div><div style><font face="courier new, monospace">    ii := ind(levels(i).le.data1_2d_as_1d.and.data1_2d_as_1d.lt.levels(i+1))</font></div><div style><font face="courier new, monospace">    mkres@gsMarkerIndex = 16          ; Filled dots</font></div><div style><font face="courier new, monospace">    mkres@gsMarkerColor = colors(i)</font></div><div style><font face="courier new, monospace">    dum_fill(i) = gsn_add_polymarker(wks,xy,height_2d_as_1d(ii),month_2d_as_1d(ii),mkres)</font></div><div style><font face="courier new, monospace">  end do</font></div><div style="font-size:small"><br></div><div style="font-size:small">--Mary</div></div><div style="font-size:small"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 10, 2014 at 2:15 AM, Ipsita Putatunda <span dir="ltr">&lt;<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div>   I have a 2D variable (nlev*ntim) with values ranges approx from 0 to 20. I want to make a scatter plot with xaxis labeling ntim and yaxis with nlev, and the values am grouping in 10 sets (0-2,2-4,4-6,6-8,8-10,10-12...etc) and trying to put it in different colors. While doing so am getting problem related to array subscription. The way am making the subsets of the values may be wrong.</div><div><br></div><div>My script is attached herewith.</div><div>it is giving error </div><div><br></div><div>fatal:Number of dimensions in parameter (0) of (ind) is (2), (1) dimensions were expected</div><div>fatal:[&quot;Execute.c&quot;:7743]:Execute: Error occurred at or near line 56 in file </div><div><br></div><div>At line 56</div><div>  ii = ind(levels(i).le.data1.and.data1.lt.levels(i+1))<br></div><div>as the data1 is 2D I have to write it some other way for making the subset.</div><div>I have tried to follow the examples</div><div><a href="http://www.ncl.ucar.edu/Applications/Scripts/scatter_6.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/scatter_6.ncl</a><br></div><div><a href="http://www.ncl.ucar.edu/Applications/Scripts/scatter_8.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/scatter_8.ncl</a><br></div><div>but getting similar issue.</div><div>I know where am making mistake,but don&#39;t know how to solve it. If anyone could help me out this issue will be appreciated.<br></div><div><br></div><div>Thanks,</div><div>Ipsita</div><div><br></div><div><br></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>