Hi List,<br><br>I guess the module 'array' in grass.script library doesn't work properly in grass 6.5 but does in 7 .<br><br><pre><span class="pygment"> import grass.script.array as garray<br><br> ....<br>
<br> slope = garray.array()<br> area = garray.array()<br><br> slope.read('r_slope')<br> area.read('r_area')<br><br> fig = plt.figure(figsize=(8, 8))<br> ax = fig.add_subplot(1, 1, 1)<br> ax.set_yscale('log')<br>
ax.set_xscale('log')<br><br> plt.plot(area,slope,'ro')<br><br></span></pre>In grass 6.5 I get:<br><br><pre><span class="pygment">Sorry, <f> is not a valid flag</span><br><span class="pygment">Sorry, <bytes> is not a valid parameter</span><br>
<span class="pygment">Sorry, <f> is not a valid flag</span><br><span class="pygment">Sorry, <bytes> is not a valid parameter</span><br><span class="pygment">Traceback (most recent call last):</span><br><span class="pygment"> File "/home/madi/gis/grass6_devel/grass-6.5.svn/scripts/<a href="http://r.drop.py">r.drop.py</a>", line 59, in <module></span><br>
<span class="pygment"> sys.exit(main())</span><br><span class="pygment"> File "/home/madi/gis/grass6_devel/grass-6.5.svn/scripts/<a href="http://r.drop.py">r.drop.py</a>", line 53, in main</span><br><span class="pygment"> plt.plot(area,slope,'ro')</span><br>
<span class="pygment"> File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 2141, in plot</span><br><span class="pygment"> ret = ax.plot(*args, **kwargs)</span><br><span class="pygment"> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 3437, in plot</span><br>
<span class="pygment"> self.autoscale_view(scalex=scalex, scaley=scaley)</span><br><span class="pygment"> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1624, in autoscale_view</span><br><span class="pygment"> XL = self.xaxis.get_major_locator().view_limits(x0, x1)</span><br>
<span class="pygment"> File "/usr/lib/pymodules/python2.6/matplotlib/ticker.py", line 1119, in view_limits</span><br><span class="pygment"> if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)</span><br>
<span class="pygment"> File "/usr/lib/pymodules/python2.6/matplotlib/ticker.py", line 1030, in is_decade</span><br><span class="pygment"> return lx==int(lx)</span><br><span class="pygment">OverflowError: cannot convert float infinity to integer</span></pre>
<br>In grass 7 it works. Did anyone experienced it?<br>Thanks,<br><br>Margherita<br>