Skip to content

Make set_x/ymargin() update axes limits, just like margins(). #16340

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 1 commit into from
May 18, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 27, 2020

Previously, setting the margins via set_x/ymargin() would not update
axes limits, unlike calling margins(). This appears to be a simple
oversight.

Closes #7093.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.3.0 milestone Jan 27, 2020
@anntzer anntzer force-pushed the set_xmargin-autoscale branch from 7ed0b3f to 1e491da Compare January 27, 2020 10:16
@QuLogic
Copy link
Member

QuLogic commented Mar 10, 2020

What does the change to collections have to do with this? It seems unrelated, or at least unexplained.

@anntzer
Copy link
Contributor Author

anntzer commented Mar 10, 2020

It's actually needed because autoscaling triggers in a place where it was previously missing, and exposes a floating point inaccuracy previously present (which was then amplified by the old round-numbers autolimits behavior).

@QuLogic
Copy link
Member

QuLogic commented Mar 10, 2020

OK, probably would have been clearer in a separate commit, or at least mentioned in the commit message.

@anntzer anntzer force-pushed the set_xmargin-autoscale branch from 1e491da to b5fd761 Compare March 10, 2020 20:44
@anntzer
Copy link
Contributor Author

anntzer commented Mar 10, 2020

fair enough, edited the commit message.

Previously, setting the margins via set_x/ymargin() would not update
axes limits, unlike calling margins().  This appears to be a simple
oversight.

The change in collections.py is necessary because the difference in
timing at which autoscale is executed now exposed a floating point
inaccuracy (which gets amplified by the old round_numbers autolimits
mode).
@anntzer anntzer force-pushed the set_xmargin-autoscale branch from b5fd761 to 2292f7b Compare May 6, 2020 13:12
@anntzer
Copy link
Contributor Author

anntzer commented May 6, 2020

The changes in collections.py were merged separately in #17206.

@efiring efiring merged commit 42b2dff into matplotlib:master May 18, 2020
@anntzer anntzer deleted the set_xmargin-autoscale branch May 18, 2020 18:58
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.

ordering issues between set_xmargin and set_xscale
3 participants