#3893·seaborn

`hue_order` breaks with pandas StringArray

Author: ded8393Created Dec 22, 2025Updated Feb 25, 2026

Extract rgg-violin.parquet.zip and run the MRE:

python
import pandas as pd
import seaborn as sns

df_tidy = pd.read_csv()

# df_tidy["hue"] = df_tidy["hue"].astype(object)

sns.violinplot(
    x="variable",
    y="value",
    data=df_tidy
    inner=None,
    hue_order=["0", "rest"],
    hue="hue",
    split=True,
    density_norm="width",
    orient="v",
)

The result should look like the left image (which it does if you uncomment the commented-out line) but looks like the right one instead:

expected shown
expected shown