You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Both support these parameters identically:# density normalizationplt.hist(data, density=True)
hist(data, density=True)
# cumulative viewplt.hist(data, density=True, cumulative=True)
hist(data, density=True, cumulative=True)
# histogram typeplt.hist(data, histtype='step')
hist(data, histtype='step')
# orientationplt.hist(data, orientation='horizontal')
hist(data, orientation='horizontal')
# log scaleplt.hist(data, log=True)
hist(data, log=True)
# color and labelplt.hist(data, color='blue', label='Data')
hist(data, color='blue', label='Data')
Migration Guide
From NumPy
# Before (NumPy)importnumpyasnphist, edges=np.histogram(data, bins=30)
# After (Khisto)fromkhistoimporthistogramhist, edges=histogram(data, max_bins=30) # max_bins is optional
From Matplotlib
# Before (Matplotlib)importmatplotlib.pyplotaspltn, bins, patches=plt.hist(data, bins=30)
# After (Khisto)fromkhisto.matplotlibimporthistn, bins, patches=hist(data, max_bins=30) # max_bins is optional