Skip to content

Fix autoscaling to exclude inifinite data limits when possible. #18276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 18, 2020
Merged

Fix autoscaling to exclude inifinite data limits when possible. #18276

merged 4 commits into from
Aug 18, 2020

Conversation

l-johnston
Copy link
Contributor

@l-johnston l-johnston commented Aug 17, 2020

Closes #18137

PR Summary

The existing code will allow an infinite data limit from one subplot to 'clobber' a finite data limit from another subplot thus defeating the intent.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant

@jklymak jklymak changed the title Fix autoscaling to exclude inifinite data limits when possible. Fix #… Fix autoscaling to exclude inifinite data limits when possible. Aug 17, 2020
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

I think there is a simpler fix.

Anyone can dismiss this review.

@tacaswell tacaswell added this to the v3.4.0 milestone Aug 17, 2020
@l-johnston
Copy link
Contributor Author

@tacaswell you're approach of changing L2544 to any will eliminate the need for L2545 to L2557 and still result in issue #18137. In my latest commit, I have re-written these lines to implement the original intent of 'ignore non-finite data limits if good limits exist' while avoiding extra looping.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This seems better, but I think could be a lot more straightforward? But no doubt there is a subtlety I'm missing.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This looks better to me. I don't quite agree with your readability concerns, but this is till far better than the original, so 👍 and thanks for working on it....

@jklymak jklymak dismissed tacaswell’s stale review August 18, 2020 00:32

Approach changed, consistent with this review...

@jklymak jklymak requested a review from tacaswell August 18, 2020 00:33
@tacaswell
Copy link
Member

It looks like the bug was that when we collapsed this from a doing x + y via copy-paste to a nested function we failed to pull out the x/y nature in the autoscaling?

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@QuLogic QuLogic merged commit 3f924bc into matplotlib:master Aug 18, 2020
@l-johnston l-johnston deleted the issue_18137 branch August 18, 2020 05:41
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.

axhspan() in empty plots changes the xlimits of plots sharing the X axis
4 participants