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 "fancy indexing".
>>> Z = numpy.zeros((2, 2))
>>> x = numpy.asarray([0, 1])
>>> y = numpy.asarray([0, 0])
>>> z = numpy.asarray([10, 42])
>>> Z[zip(y, x)] = z
>>> Z
array([[ 10., 42.],
[ 0., 0.]])
hth and is appropriate,
Friedrich
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users