how to have n bins plt hist code example
Example 1: plt normalized histogram
plt.hist(data, density=True)
Example 2: plt.hist using bins
counts, bins = np.histogram(data)
plt.hist(bins[:-1], bins, weights=counts)
plt.hist(data, density=True)
counts, bins = np.histogram(data)
plt.hist(bins[:-1], bins, weights=counts)