I posted to scipy because of histogram2d being in numpy, sorry about that.
Now the stupid question, why can't imshow directly parse histogram2d, without the transitory extent object?
Anyway, I am happy that there is a simple way as explained below!
John Hunter wrote:
On Fri, Sep 5, 2008 at 10:36 AM, Johann Cohen-Tanugi > <cohen@...1565...> wrote:
hi, I hope someone can quickly point me to some doc.
I can do imshow(histogram2d(x,y)) but then I miss the x and y binning
If I do imshow(histogram2d(x,y)) I get:
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (115, 0))
matplotlib questions are best addressed to the matplotlib-users mailing list at
histogram2d returns H, xedges and yedges. The first argument should
be passed to imshow, and the second two can be used to get the extents
In : x, y = np.random.randn(2, 100000)
In : H, xedges, yedges = np.histogram2d(x, y, bins=50)
In : extent = [xedges, xedges[-1], yedges, yedges[-1]]
In : imshow(H, extent=extent)
Out: <matplotlib.image.AxesImage object at 0x9377bcc>
SciPy-user mailing list