For a class project I am plotting a barchart. I have a python list with a bunch of labels (even, odd, squares, powers of 3, etc) and a numpy array to hold probabilities associated with each label (in the same order as the labels list). When I plot my chart
labels = ["even", "odd", "squares", "powers of 3"]
fig, ax = plt.subplots()
ax.barh(labels, probability)
it puts the barchart values in reverse alphabetical order so instead of it being ordered even, odd, squares it is ordered squares, powers of 3, odd, even, etc. How can I keep my plot in the same order as my list?