See my other post for how to make the sum of all bins in a histogram equal to one:
https://stackoverflow.com/a/16399202/1542814
Copy & Paste:
weights = np.ones_like(myarray)/float(len(myarray))
plt.hist(myarray, weights=weights)
where myarray contains your data
More Related Contents:
- How to find the exact intersection of a curve (as np.array) with y==0?
- How to create a legend for 3D bar in matplotlib?
- How do you change the size of figures drawn with Matplotlib?
- Set Colorbar Range in matplotlib
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- Matplotlib log scale tick label number formatting
- scipy: savefig without frames, axes, only content
- How to remove the space between subplots in matplotlib.pyplot?
- Matplotlib yaxis range display using absolute values rather than offset values?
- Plotting a decision boundary separating 2 classes using Matplotlib’s pyplot
- No module named when using PyInstaller
- How to plot empirical cdf (ecdf)
- Matplotlib: TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
- figure of imshow() is too small
- How to ‘turn off’ blurry effect of imshow() in matplotlib?
- how to annotate heatmap with text in matplotlib
- 2D and 3D Scatter Histograms from arrays in Python
- Python equivalent to ‘hold on’ in Matlab
- Generating movie from python without saving individual frames to files
- How to overplot a line on a scatter plot in python?
- Python: find contour lines from matplotlib.pyplot.contour()
- setting spacing between grouped bar plots in matplotlib
- How to automatically annotate maximum value in pyplot
- matplotlib show() doesn’t work twice
- line, = plot(x,sin(x)) what does comma stand for?
- How to have logarithmic bins in a Python histogram
- How to shade region under the curve in matplotlib
- How to have actual values in matplotlib Pie Chart displayed
- Figure to image as a numpy array
- Matplotlib – Finance volume overlay