Suppose I have data [1,2,3, 7,8,9,9, 20,30,40,100,1000] for which I want to draw a histogram with Python. All the bins I care about is [0,5], [5,10], and [10, +∞). How can I do it?
The following wouldn't do it, of course.
import matplotlib.pyplot as plt
data = [1,2,3, 7,8,9,9, 20,30,40,100,1000]
plt.figure()
plt.hist(data, bins=5, color="rebeccapurple")
plt.show()