[GRASS-user] grass.script.array

Margherita Di Leo diregola at gmail.com
Wed Dec 22 14:38:18 EST 2010


Hi List,

I guess the module 'array' in grass.script library doesn't work properly in
grass 6.5 but does in 7 .

    import grass.script.array as garray

    ....

    slope = garray.array()
    area = garray.array()

    slope.read('r_slope')
    area.read('r_area')

    fig = plt.figure(figsize=(8, 8))
    ax = fig.add_subplot(1, 1, 1)
    ax.set_yscale('log')
    ax.set_xscale('log')

    plt.plot(area,slope,'ro')

In grass 6.5 I get:

Sorry, <f> is not a valid flag
Sorry, <bytes> is not a valid parameter
Sorry, <f> is not a valid flag
Sorry, <bytes> is not a valid parameter
Traceback (most recent call last):
  File "/home/madi/gis/grass6_devel/grass-6.5.svn/scripts/r.drop.py",
line 59, in <module>
    sys.exit(main())
  File "/home/madi/gis/grass6_devel/grass-6.5.svn/scripts/r.drop.py",
line 53, in main
    plt.plot(area,slope,'ro')
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 2141, in plot
    ret = ax.plot(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 3437, in plot
    self.autoscale_view(scalex=scalex, scaley=scaley)
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1624,
in autoscale_view
    XL = self.xaxis.get_major_locator().view_limits(x0, x1)
  File "/usr/lib/pymodules/python2.6/matplotlib/ticker.py", line 1119,
in view_limits
    if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)
  File "/usr/lib/pymodules/python2.6/matplotlib/ticker.py", line 1030,
in is_decade
    return lx==int(lx)
OverflowError: cannot convert float infinity to integer


In grass 7 it works. Did anyone experienced it?
Thanks,

Margherita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20101222/c47ded66/attachment.html


More information about the grass-user mailing list