Python Pandas: How to sort group bar chart?

I have the following code that is currently displaying the group bar chart.

plt.ylabel('Income Count')
plt.suptitle("Training Data: Workclass vs Income", fontweight="bold")

The current chart looks like this:

enter image description here

I want to display the chart by sorting the orange section (income >50K) in descending order. So the tallest orange bar should be on the left side. How do I do that?

Read more here:

Content Attribution

This content was originally published by hongkongbboy at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: