| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Nominally 👍. Share @efiring 's concern about performance, but this seems a good a place as any in the code to force application of the aspect. There is still a path confusion (create axes, set aspect, ask position, change limits) but is a more limited path that the current one (create axes, set aspect, set limits, ask position, draw). |
Sorry, something went wrong.
|
I'm less concerned about performance. I think if the user asks for the position, and they specify "original=False" they should get what they ask for. If its a performance issue for them, then they can figure things out, and then hardcode. A thornier question, however, is if the default should be "original=True", since thats what most users were getting when calling get_position(). That is if they didn't know the trick of calling ax.apply_aspect(). But for all I can tell that trick would only be discernible from reading the source code. I would never have thought about calling that, and I got pretty heavily into the source code in #9082. |
Sorry, something went wrong.
There was a problem hiding this comment.
From the standpoint of internals, the api_changes is a little bit misleading; with original=False it was returning the active position, which at that point might or might not be identical to the original, and which might or might not be the position after the draw. The latter is still true, but this PR makes it more likely that get_position(False) returns what the user might reasonably expect. So I think it is a net gain, and worth trying.
Sorry, something went wrong.
|
I'm sticking this in 2.2. Feel free to re-milestone, but its a pretty small change. |
Sorry, something went wrong.
|
I'd be in favour of putting this in 3.0 since it's a change that should probably go out in an rc before the final release. |
Sorry, something went wrong.
|
Now that we are on 3 can this go in? |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Currently, ax.get_position(original=False) doesn't tell us the position of an Axes if its aspect ratio has been set, unless we call ax.apply_aspect() or fig.draw() beforehand. This is a bit annoying, because its hard to imagine why we would want to ask for the axes position without the proper aspect ratio already having being applied, particularly if we can get the original position by calling ax.get_position(original=True).
This PR, simply calls self.apply_aspect() if original=False.
The doc string was also updated to what I hope is numpydoc compliance.
Closes #9207
PR Checklist