python hist min max code example
Example 1: plt.hist using bins
counts, bins = np.histogram(data)
plt.hist(bins[:-1], bins, weights=counts)
Example 2: set xlim histogram python
import numpy as np
import matplotlib.pyplot as plt
x = np.random.uniform(-100, 100, 1000)
plt.hist(x, bins=30, range=(-50, 50))
plt.show()