Skip to content

Conversation

@cvanelteren
Copy link
Collaborator

@cvanelteren cvanelteren commented Nov 16, 2025

Closes #412

This PR addresses an issue where limits are reset when adding bar labels in a loop (see #412). The issue occurs because the bar_labels expects that the bar are in a container which will set the range on all the bars. This PR fixes this by considering dataLim directly rather than the BarContainer.

@cvanelteren cvanelteren changed the title only adjust other Hotfix: bar labels cause limit to reset for unaffected axis. Nov 16, 2025
@cvanelteren cvanelteren force-pushed the hotfix-bar-labels-reset branch from 2867e89 to 7bc099d Compare November 16, 2025 08:59
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cvanelteren
Copy link
Collaborator Author

Hmm had a look at this for a while and I am not really understanding how the xlimits are set. For BarContainers this goes well but not for iterative calls -- will return to this. Putting it to draft.

@cvanelteren cvanelteren marked this pull request as draft November 16, 2025 10:46
@cvanelteren cvanelteren force-pushed the hotfix-bar-labels-reset branch from 2f38a92 to 46c2f29 Compare November 16, 2025 12:22
@cvanelteren cvanelteren marked this pull request as ready for review November 16, 2025 19:40
@cvanelteren cvanelteren requested a review from beckermr November 16, 2025 19:40
@cvanelteren
Copy link
Collaborator Author

The difference on the plot is minor some shifting but everything else looks ok.

Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

I don't understand the pr given the description. The other axis is still reset. Can you update the description for me so I can understand better why is going on?

@cvanelteren
Copy link
Collaborator Author

Done

@cvanelteren cvanelteren enabled auto-merge (squash) November 18, 2025 01:28
@cvanelteren cvanelteren disabled auto-merge November 18, 2025 01:28
@cvanelteren cvanelteren merged commit fa01291 into Ultraplot:main Nov 18, 2025
16 of 25 checks passed
@cvanelteren cvanelteren deleted the hotfix-bar-labels-reset branch November 18, 2025 01:28
@cvanelteren
Copy link
Collaborator Author

Great. I will draft a release and bump the number.

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.

Limits are reset when calling bar_labels

2 participants