Skip to content

hue_order breaks with pandas StringArray #3893

@ded8393

Description

@ded8393

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions