Supposed I have the data set [1,1,1,2,2] and want the bins [1,2),[2,3) then I can use the follwoing code to generate a histogram:
import matplotlib.pyplot as plt
data = [1,1,1,2,2]
values = [1,2,3]
plt.hist(data,bins = values)
plt.show()
Is there any way that I can give the height of each bin instead of the data? In this case it'd be 3 and 2 respectively.
Thanks!