Skip to content

Display an artist label instead of x y not working [seaborn] #80

@arnaudvre

Description

@arnaudvre

I'm using Seaborn, instead of the artist label I get _child0 for example (number is specific to a line). Interestingly on version 0.5.2-2 (apt default) the label shows intermittently, moving to 0.5.3 (pip latest/default) only x and y.

    df = pd.DataFrame(pandas_dict_for_dataframe)

    dfm = df.melt('Date', var_name='Item', value_name='Price')

    g = sns.catplot(x="Date", y="Price", hue='Item', data=dfm, kind='point', height=8, aspect=16 / 8., dodge=2)

    plt.xticks(rotation=45, ha='right')

    mplcursors.cursor(hover=True).connect("add", lambda sel: sel.annotation.set_text(sel.artist.get_label()))
    plt.show()

image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions