[GRASS-user] Re: [GRASS-dev] Re: GRASS to Numpy [was: Re: List of new features in GRASS 7 (in trac)]

Timmie:

Here is a example that I was trying out with Spearfish location:

### PY ###

import scipy.io as sio
elev = sio.loadmat('elev.mat')
elev.get('map_data')
data = elev.get('map_data')
import pylab
pylab.plot(data)
pylab.show()

pylab.contour(data)
pylab.contour(data.reverse())

import numpy as np

data_rev = data[::-1]
pylab.contour(data_rev)
# => this is a quick plot. basemap mapping may provide a
nicer map!

#######

neat. if you could add that (and whatever other tips you think are
useful) to the wiki site it would be really great:

http://grass.osgeo.org/wiki/GRASS_and_Python#Interfacing_with_NumPy

thanks,
Hamish