Getting information for bins from the histogram function
The return values of plt.hist are: Returns: tuple : (n, bins, patches) or ([n0, n1, …], bins, [patches0, patches1,…]) So all you need to do is capture the return values appropriately. For example: import numpy as np import matplotlib.pyplot as plt # generate some uniformly distributed data x = np.random.rand(1000) # create the histogram (n, … Read more