79803725

Date: 2025-10-29 11:30:21
Score: 0.5
Natty:
Report link

Couple years later... Turns out there are now order and hue_order arguments on the barplot method.

Documentation voilĂ : https://seaborn.pydata.org/generated/seaborn.barplot.html

for example:

import pandas
import seaborn

values = pandas.DataFrame({'value': [0.3, 0.112, 0.561, 0.235]})
values_sorted = v['value'].sort_values(ascending=False)

seaborn.barplot(
    x=values_sorted.index, 
    y=values_sorted,
    order=values_sorted.index,
);
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: ewerybody