Skip to content

Legend: double-click a series to isolate it (Plotly-style) #505

Description

@JuanCruzC97

Summary

xy.legend(toggle=True) already lets a single click hide/show one series, and highlight=True dims the others on hover. Requesting a second step: double-clicking a legend entry isolates that series, matching Plotly's legendclick / legenddoubleclick model.

Requested behavior

  • Single click (unchanged): toggles that entry's series visibility.
  • Double click:
    • If the chart isn't already isolated to this series: hide every other
      series, leaving only the double-clicked one visible.
    • If the chart is already isolated to this ser
      double-click): restore all series to visible.

Use case

We're evaluating xy as a third plotting backend alongside Plotly/Seaborn, including charts where each legend entry is a data-driven category rather than a handful of manually chosen traces. With more than 3-4 categories, single-click-to-toggle means N-1 clicks to inspect just one series. Double-click-to-isolate is the one-click path we (and Plotly users generally) rely on for that.

Environment

  • xy 0.0.6
  • Python 3.12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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