I’ve created a summarized dataframe of my data, and ordered on two levels.
shipping_region = shipping_region.sort_values(by=['region','sum_shipping'], ascending=[False,False])
its correctly ordered, but when I plot it with FacetGrid, it takes the fleet_company order form the first facet, and transfers to the others, so the bars are only properly ordered in the first facet.
import seaborn as sns
sns.set_style('dark')
g = sns.FacetGrid(shipping_region,row='region', hue='fleet_company', height=6, aspect=1.5, sharey=False, sharex=False)
g.map(sns.barplot,'sum_shipping','fleet_company')
plt.show()
I expected the plots to simply break the dataframe in the amount of regions and plot the fleet companies in the same order of the dataframe, but this just doesn’t happen.
New contributor
guiolivera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.