Here is my sorted series
STATE_CD
AZ 1425
CA 897
TX 246
WA 184
IL 115
FL 112
GA 103
VA 101
PA 100
CO 89
NC 77
NV 70
NY 70
OH 62
MI 60
NJ 57
Trying to plot this as a bar chart
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(30,16))
ax.bar(online_states.index, online_states, color='r')
ax.set_xlabel(xlabel='State', size=20)
ax.set_ylabel(ylabel='Online Students With Interactions' , color='b', size=20)
ax.set_xticklabels(online_states.sort_values(ascending=False).index, rotation=45, fontsize=20)
ax.set_yticklabels(online_states.sort_values(ascending=False), rotation=0, fontsize=20)
plt.show()
But the output is showing the values inverted on the Y axis? Tried inverting Y axis and a few other things but never get expected result (with 1425 as the top value on the Y axis).
What am I doing wrong?