-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update Ellipse position with ellipse.center #11057
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
Conversation
lib/matplotlib/patches.py
Outdated
@@ -1439,7 +1439,7 @@ def __init__(self, xy, width, height, angle=0.0, **kwargs): | |||
""" | |||
Patch.__init__(self, **kwargs) | |||
|
|||
self.center = xy | |||
self.xy = xy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use self._center
instead of self.xy
. We shouldn't add a public attribute. While xy
is used as a variable name in __init__
, I don't think it's a good choice. "center" is more semantic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to self._center
, thanks!
This for sure breaks a lot of existing code. I personally do not quite see the reason to hide the attribute, but if people think this should be done, it should be done for all attributes of all patches and the respective setters and getters should be introduced. |
The |
omg, I did not see that. Sorry. All good. |
Thanks for what looks like your first contribution @eschutz! |
Thank you! |
I think we should move away from this |
PR Summary
Fixed an issue where Ellipses would not move when
ellipse.center
was set.Example:
Old


New
PR Checklist