thanks Johan, 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!
thanks again, Johann John Hunter wrote: > On Fri, Sep 5, 2008 at 10:36 AM, Johann Cohen-Tanugi > <[EMAIL PROTECTED]> wrote: > >> hi, I hope someone can quickly point me to some doc. >> I can do imshow(histogram2d(x,y)[0]) but then I miss the x and y binning >> correct labels. >> 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 > > http://lists.sourceforge.net/mailman/listinfo/matplotlib-users > > 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 [26]: x, y = np.random.randn(2, 100000) > > In [27]: H, xedges, yedges = np.histogram2d(x, y, bins=50) > > In [28]: extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]] > > In [29]: imshow(H, extent=extent) > Out[29]: <matplotlib.image.AxesImage object at 0x9377bcc> > > I > _______________________________________________ > SciPy-user mailing list > [EMAIL PROTECTED] > http://projects.scipy.org/mailman/listinfo/scipy-user > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users