Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Only allow set_adjustable("datalim") for axes with standard data ratios. #14835

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
Jul 18, 2019

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 17, 2019

If an Axes subclass overrides get_data_ratio to anything else than
"ratio of data limits after application of scales" (e.g. Polar always
returns 1), then the data limits manipulation in apply_aspect won't
achieve the proper data ratio anyways, so disable setting adjustable to
"datalim" in that case.

For example, calling axis("equal") on polar axes (which also sets
adjustable to "datalim") will now error out instead of resulting in a
nonsensical plot.

Closes #14608.

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 force-pushed the adjustablestandardratio branch from bf5eb3f to d283c37 Compare July 17, 2019 20:32
If an Axes subclass overrides get_data_ratio to anything else than
"ratio of data limits after application of scales" (e.g. Polar always
returns 1), then the data limits manipulation in apply_aspect won't
achieve the proper data ratio anyways, so disable setting adjustable to
"datalim" in that case.

For example, calling `axis("equal")` on polar axes (which also sets
adjustable to "datalim") will now error out instead of resulting in a
nonsensical plot.
@anntzer anntzer force-pushed the adjustablestandardratio branch from d283c37 to 2cc8e14 Compare July 17, 2019 20:49
@jklymak
Copy link
Member

jklymak commented Jul 17, 2019

Seems good to me; querying @efiring because he is trying to keep this stuff consistent.

@QuLogic QuLogic merged commit 277c042 into matplotlib:master Jul 18, 2019
@QuLogic QuLogic added this to the v3.2.0 milestone Jul 18, 2019
@anntzer anntzer deleted the adjustablestandardratio branch July 18, 2019 08:07
@anntzer anntzer mentioned this pull request Jul 18, 2019
6 tasks
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.

Issue with using plt.axis('equal') with plt.polar(theta,r) plot
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.