Re: [Matplotlib-users] Normalized Histograms

2011-11-30 Thread Tony Yu
On Wed, Nov 30, 2011 at 11:42 AM, Jeffrey Blackburne < jblackbu...@alum.mit.edu> wrote: > Hi Steven, > > Try this: > > import numpy as np > import numpy.random > import matplotlib as mpl > import matplotlib.pyplot as plt > > x = np.random.randn(1000) > h, binedg = np.histogram(x, 10) > > wid = bin

Re: [Matplotlib-users] Normalized Histograms

2011-11-30 Thread Jeffrey Blackburne
Hi Steven, Try this: import numpy as np import numpy.random import matplotlib as mpl import matplotlib.pyplot as plt x = np.random.randn(1000) h, binedg = np.histogram(x, 10) wid = binedg[1:] - binedg[:-1] plt.bar(binedg[:-1], h/float(x.size), width=wid) On Nov 30, 2011, at 10:25 AM, Steven B

[Matplotlib-users] Normalized Histograms

2011-11-30 Thread Steven Boada
Hi Users, I'm looking to make a histogram that is normalized by the total number of items shown in the histogram. For example: Let's say that I have an array 1000 items long. If I make a histogram in the normal way hist(x,10) then I get a histogram showing the total number of items in each bin