Re: [Matplotlib-users] creating mesh data from xyz data

2009-09-10 Thread Matthias Michler
Hi Giuseppe, As far as I understand you are looking for numpy.meshgrid, e.g. # grid in x- direction x = np.linspace(0, 1, 10) # grid in y-direction y = np.arange(5) # generate 2D-vectors out of x and y x, y = np.meshgrid(x, y) print np.shape(x) print np.shape(y) Furthermore you have to reshape

Re: [Matplotlib-users] creating mesh data from xyz data

2009-09-09 Thread Timo Spielmann
Hi Giuseppe you can load your datafile with pylab... see my little function which i'm using import pylab as pl def readXY(filename): x,y,z = pl.load(filename, unpack=True) return x,y,z (X, Y, Z) = readXY("datafile.dat") after that you have your values in the arrays X;Y;Z kind regards

Re: [Matplotlib-users] creating mesh data from xyz data

2009-09-09 Thread Giuseppe Aprea
Hi list, I have some files with data stored in columns: x1     y1     z1 x2     y2     z2 x3     y3     z3 x4     y4     z4 x5     y5     z5 ... and I need to make a contour plot of this data using matplotlib. The problem is that contour plot functions usually handle a different kind of inpu

[Matplotlib-users] creating mesh data from xyz data

2009-09-08 Thread Giuseppe Aprea
Hi list, I have some files with data stored in columns: x1     y1     z1 x2     y2     z2 x3     y3     z3 x4     y4     z4 x5     y5     z5 ... and I need to make a contour plot of this data using matplotlib. The problem is that contour plot functions usually handle a different kind of inpu