Skip to content

Conversation

@tev-dixon
Copy link
Contributor

@rhshadrach rhshadrach changed the title Fix #59429 stacked bar label position BUG: Fix #59429 stacked bar label position Nov 6, 2024
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

assert result == expected

def test_bar_stacked_label_position_with_zero_height(self):
df = DataFrame({"A": [3, 0, 1], "B": [0, 2, 4], "C": [5, 0, 2]})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you start this test with a comment referencing the GH issue. E.g. see the test immediately below for an example.

Plotting
^^^^^^^^
-
- Bug in :meth:`DataFrame.plot.bar` with ``stacked=True`` where labels on stacked bars with zero-height segments were incorrectly positioned at the base instead of the label position of the previous segment (:issue:`59429`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note should be move to v3.0.0.rst.

Copy link
Member

@rhshadrach rhshadrach Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.3.0 is a "special" release in that we are not doing it from the main branch. We are only backporting certain PRs to the 2.3.x branch.

@rhshadrach rhshadrach added this to the 3.0 milestone Nov 6, 2024
@tev-dixon
Copy link
Contributor Author

tev-dixon commented Nov 6, 2024

Thank you! I made the requested changes and synced the branch. This is ready for re-review after the checks complete.
[x] removed the errant documentation from doc/source/whatsnew/v2.3.0.rst
[x] added documentation to doc/source/whatsnew/v3.0.0.rst
[x] added the github issue tracking number to the test in pandas/tests/plotting/frame/test_frame.py

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rhshadrach rhshadrach merged commit b5e62ef into pandas-dev:main Nov 7, 2024
51 checks passed
@rhshadrach
Copy link
Member

Thanks @tev-dixon!

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

Labels

2 participants