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
Giuseppe Aprea wrote:
> 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 input:
>
> X=[[x1,x2,x3,x4,x5,x6],
> [x1,x2,x3,x4,x5,x6],
> [x1,x2,x3,x4,x5,x6],...
>
> Y=[[y1,y1,y1,y1,y1,y1],
> [y2,y2,y2,y2,y2,y2],
> [y3,y3,y3,y3,y3,y3],.....
>
> Z=[[z1,z2,z3,z4,z5,z6],
> [z7,z8,zz9,z10,z11,z12],....
>
> I usually load data using 3 lists: x, y and z; I wonder if there is
> any function which is able to take these 3 lists and return the right
> input for matplotlib functions.
>
> cheers
>
> giuseppe
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users