I am trying to put some data into an imshow() plot. My problem is that the data does not come as a MxN array but as a 3xN array (x- and y coordinate and value). The points are NOT arranged as a regular grid but lie within [xmin,xmax,ymin and ymax]=[-pi/2,pi/2,0,3.5].
In [117]: shape(data)
Out[117]: (3L, 102906L)
How can I get a nice image plot from that data? Thank you very much for any help.
btw the data represents temperature values on the surface of a rod as a function of axial and azimuthal position, think of a cfd-mesh.
I recommend using the griddata-method for interpolation. A sample would be:
I guess transition from your 3*X-array to three X-arrays is obvious.
The result is:
Red points show the "original" positions of the data, blue points for the now regularly spaced data.
griddata returns a masked array. All points for which the interpolation cannot be evaluated are masked and then plotted as white areas.
HTH, Thorsten