[Matplotlib-users] Plotting irregular 2d data

2010-06-08 Thread Nikolaus Rath
Hi, I have a 1d array Z that unfortunately contains information about a two dimensional surface. The mapping is nontrivial (i.e. Z is not just a sequence of column or row information that I could reshape) but homogenous (i.e. there is a rectangular grid and Z contains data for each vertex). The x

Re: [Matplotlib-users] Plotting irregular 2d data

2010-06-08 Thread Friedrich Romstedt
Z = numpy.zeros((y_shape, x_shape)) x = your_flat_indices_in_x y = your_flat_indices_in_y z = your_flat_z_data If you have only coordinates, then try to figure out the indices in some way. Then do: Z[zip(y, x)] = z and figure out the coordinates that correspond to the mesh meant by Z. It's