Fix errorbar autoscaling inconsistency on log axes (fixes #31462)#31478
Open
Vikash-Kumar-23 wants to merge 1 commit intomatplotlib:mainfrom
Open
Fix errorbar autoscaling inconsistency on log axes (fixes #31462)#31478Vikash-Kumar-23 wants to merge 1 commit intomatplotlib:mainfrom
Vikash-Kumar-23 wants to merge 1 commit intomatplotlib:mainfrom
Conversation
rcomer
reviewed
Apr 9, 2026
| minx = np.nanmin(datalim.xmin) | ||
| maxx = np.nanmax(datalim.xmax) | ||
| miny = np.nanmin(datalim.ymin) | ||
| maxy = np.nanmax(datalim.ymax) |
Member
There was a problem hiding this comment.
Do you know why this worked fine for the linear scale but not for the log scale?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
closes #31462
This PR fixes an autoscaling inconsistency for
errorbaron log-scaled axes.Why this change is necessary
When log scale is set before calling
errorbar, autoscaling can produce incorrect lower limits (often collapsing near 1).If
errorbaris called first and log scale is applied afterward, the limits are correct.This order-dependent behavior is unexpected and inconsistent.
What this PR changes
errorbarBefore fix (incorrect behavior)
scale → errorbarAfter fix (correct behavior)
Minimum self-contained example
Expected after this PR
AI Disclosure
AI tools were used to assist in drafting text and suggesting validation scenarios.
All code changes, final implementation decisions, and verification were done manually.
PR checklist