python hist 50 code example Example: plt.hist using bins counts, bins = np.histogram(data) plt.hist(bins[:-1], bins, weights=counts)