Example array:
a=np.array([1,2,3,4,4,4,2,1,1,1,1])
I want to create a histogram from the array, and if I use matplotlib.pyplot's histogram:
import matplotlib.pyplot as plt
plt.hist(a,bins=[1,2,3,4,5])
I get this:

How do I get the columns in different colors? and how do i get labels, like if a green column the legend shows number 1 is green.
I suspect I might create four different datasets, but that I can't get to work..