How to sort a boxplot by the median values in pandas
- by Chris
I've got a dataframe outcome2 that I generate a grouped boxplot with in the following manner:
In [11]: outcome2.boxplot(column='Hospital 30-Day Death (Mortality) Rates from Heart Attack',by='State')
plt.ylabel('30 Day Death Rate')
plt.title('30 Day Death Rate by State')
Out [11]:
What I'd like to do is sort the plot by the…