Skip to content

BUG:#22183 : Fixed Groupby Legend Labels for scatter plot#66027

Open
Saihritesh wants to merge 3 commits into
pandas-dev:mainfrom
Saihritesh:fixed-scatterplot-groupby
Open

BUG:#22183 : Fixed Groupby Legend Labels for scatter plot#66027
Saihritesh wants to merge 3 commits into
pandas-dev:mainfrom
Saihritesh:fixed-scatterplot-groupby

Conversation

@Saihritesh

Copy link
Copy Markdown

Summary

Fixes missing legend labels for DataFrameGroupBy.plot.scatter() when legend=True is specified.

Previously, grouped scatter plots did not propagate the group name as the default label to the underlying scatter plot, resulting in legends without the expected group labels.

This change forwards the group name as the default label for scatter plots only when no explicit label is provided, preserving existing user-specified labels.

Tests

  • Added a regression test covering DataFrameGroupBy.plot.scatter(..., legend=True) to verify that the legend contains the expected group labels.

@Saihritesh Saihritesh requested a review from rhshadrach as a code owner June 25, 2026 20:20
@Saihritesh Saihritesh changed the title BUG:#22183 : Fixed Groupby Legend Labels ensuring parity with scatte… BUG:#22183 : Fixed Groupby Legend Labels for scatter plot Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant