-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add set/get for ellipse width/height #16395
Conversation
Tests are failing. |
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.
Thanks for the PR. Overall, this looks good!
Please fix the style issues indicated by flake8:
./lib/matplotlib/patches.py:1453:1: D300 Use """triple double quotes"""
./lib/matplotlib/patches.py:1455:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1462:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1464:1: D300 Use """triple double quotes"""
./lib/matplotlib/patches.py:1468:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1470:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1472:1: D300 Use """triple double quotes"""
./lib/matplotlib/patches.py:1474:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1481:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1483:1: D300 Use """triple double quotes"""
./lib/matplotlib/patches.py:1487:1: W293 blank line contains whitespace
./lib/matplotlib/patches.py:1490:1: E302 expected 2 blank lines, found 1
lib/matplotlib/patches.py
Outdated
@@ -1449,6 +1449,43 @@ def get_center(self): | |||
|
|||
center = property(get_center, set_center) | |||
|
|||
def set_width(self, width): | |||
''' | |||
Set the width of the ellipse |
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.
Set the width of the ellipse | |
Set the width of the ellipse. |
Please finish the sentences with a period (following PEP-257) - also in the other methods. I know, there are some missing in the current docs, but we try to move towards a more consistent doc style.
Let me add the ellipse angle as well before merging the PR |
Codecov Report
@@ Coverage Diff @@
## master #16395 +/- ##
==========================================
- Coverage 80.85% 80.78% -0.07%
==========================================
Files 307 307
Lines 75745 75767 +22
Branches 9690 9692 +2
==========================================
- Hits 61245 61211 -34
- Misses 11961 12012 +51
- Partials 2539 2544 +5
Continue to review full report at Codecov.
|
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.
Commits should be squashed. (Either by OP, or as part of the merge via github by the second reviewer).
Thanks for your first contribution to Matplotlib 🎉 |
PR Summary
Add methods to set/get the width/height for Ellipse Patches.
Mostly the setter methods are interesting, as they set
self.stale=True
to force redrawing the patch at the next plot call.I used those methods for interactive plotting, they have similar use than the existing
set_center
.The
stale=True
was not be obvious to update the shape size interactively so I think the method could benefit others.PR Checklist