Nick,

Check out this demo on the MPL website:
http://matplotlib.sourceforge.net/examples/api/histogram_demo.html

This line in particular:
n, bins, patches = ax.hist(x, 50, normed=...)

The variables 'n' and 'bins' can be fed into ax.bar() later on. I could swear 
that this was clear from the docstring, but that's definitely not the case 
anymore. I'll submit a patch to the list tomorrow if I can remember to work on 
it some tonight. 

Do see the docstring for an explanation of what can be done with the 'patches' 
variable.

Hope this helps,
-paul

> -----Original Message-----
> From: Nick Schurch [mailto:n.schu...@dundee.ac.uk]
> Sent: Tuesday, May 18, 2010 6:56 AM
> To: matplotlib-users@lists.sourceforge.net
> Subject: [Matplotlib-users] hist question...
> 
> Hi all,
> 
> Is there anyway of re-ploting the distribution generated by hist at a
> later point? I want to call it in a subroutine and have the resulting
> distributions returned so I can plot them without having to
> recalculate them each time. I couldn't find anything int he online
> documentation but I figured it'd be something like:
> 
> import matplotlib.pyplot as plt
> hplot=plt.hist(data, bins=1000)
> 
> plt.hist(hplot)
> or
> plt.hist(hplot[0],bins=hplot[1])
> or
> plt.plot(hist)
> 
> 
> etc, but nothing works.
> 
> --
> Cheers,
> 
> Nick Schurch
> 
> Data Analysis Group (The Barton Group),
> School of Life Sciences,
> University of Dundee,
> Dow St,
> Dundee,
> DD1 5EH,
> Scotland,
> UK
> 
> Tel: +44 1382 388707
> Fax: +44 1382 345 893
> 
> -------------------------------------------------------------------------
> -----
> 
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to