python-matplotlibHow to customize histogram bins
import matplotlib.pyplot as plt
x = [1,2,5,1,2,3,5,6,7,4,2,2,4,5,6]
plt.hist(x,bins=[0,5,6,7],edgecolor='white')
plt.show()ctrl + c| import matplotlib.pyplot as pltloads Matplotlib module to use plotting capabilities | .hist(plots histogram for specified data | 
| binswe can specify list of values to build bins based on | edgecolorsets histogram bar border color | 
| .show()render chart in a separate window | |
Usage example
import matplotlib.pyplot as plt
x = [1,2,5,1,2,3,5,6,7,4,2,2,4,5,6]
plt.hist(x,bins=[0,5,6,7],edgecolor='white')
plt.show()More of Python Matplotlib
- How to plot 3D heatmap
- How to check Matplotlib version
- Errorbar usage example
- How to change boxplot colors
- How to plot specific country from world map
- How to plot world map
- How to plot array
- How to plot data from JSON
- How to plot specific continent from world map
- How to change figure title
See more codes...
