Skip to content

Two legends have appeared #309

@lwq-star

Description

@lwq-star

Using this code produced two legends, likely due to a conflict between ultraplot and seaborn.

import ultraplot as uplt
import seaborn as sns

fig, axs = uplt.subplots(journal='nat2')

df = sns.load_dataset("titanic")
sns.violinplot(data=df, x="class", y="age", hue="alive")

axs.legend(
    loc='lower right',
    frameon=False,  
    title=None,
)
Image

Everything works normally when ultraplot is not used.

import seaborn as sns
import matplotlib.pyplot as plt

df = sns.load_dataset("titanic")
sns.violinplot(data=df, x="class", y="age", hue="alive")
plt.legend(
    loc='lower right',
    frameon=False, 
    title=None, 
)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions