-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add an Annulus patch class #9888
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
Cool! Now, what might be interesting to see is how this could possibly be
an extension of the Arc class?
At a minimum, you will need an entry in the "what's new" directory in the
docs, and some image tests.
…On Thu, Nov 30, 2017 at 4:04 AM, Hannes Breytenbach < ***@***.***> wrote:
PR Summary
Adds an the Annulus class to the patches library. This can be used to
create annular ellipses or circle patches. I include a small example below
that demos the usage.
PR Checklist
- Has Pytest style unit tests
- Code is PEP 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
import matplotlib.pyplot as plt
from matplotlib.patches import Annulus
fig, ax = plt.subplots()
cir = Annulus((0.5, 0.5), 0.2, 0.05, fc='g') # circular annulus
ell = Annulus((0.5, 0.5), (0.5, 0.3), 0.1, 45, # elliptical
fc='m', ec='b', alpha=0.5, hatch='xxx')
ax.add_patch(cir)
ax.add_patch(ell)
ax.set_aspect('equal')
[image: mpl annulus]
<https://user-images.githubusercontent.com/5623552/33421938-820cfe60-d5bc-11e7-9931-166806dab881.png>
------------------------------
You can view, comment on, or merge this pull request online at:
#9888
Commit Summary
- add Annulus patch
- 'add Annulus patch for making elliptical annuli'
File Changes
- *M* lib/matplotlib/patches.py
<https://github.com/matplotlib/matplotlib/pull/9888/files#diff-0> (89)
Patch Links:
- https://github.com/matplotlib/matplotlib/pull/9888.patch
- https://github.com/matplotlib/matplotlib/pull/9888.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9888>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-Dsso6QNR6Bz7Pop2Vz3b2P4S_mpks5s7m-AgaJpZM4QwOL3>
.
|
Something similar is supported by |
Yes, the What might also be quite nice is to have a generic class that can transform any |
95f5025
to
db7d907
Compare
@astromancer This still looks viable if you have time to address @eric-wieser comments and do a rebase. Please (politely!) ping if you don't get reviews so we remember this. We have many open PRs so things get buried. |
@jklymak Thanks for the ping. It's been on my mind to get back to this for some time now. Will have a look at folding in your comments in the next week or so. |
Something appears to have gone catastrophically wrong with your merge commit |
Yeah my bad, any idea how to fix this? |
Well, your merge commit 9e0739e Edit: whoops, links were bad. Merge diff: master...9e0739e One parent: master...9f12372 The other parent: master...b8e8976 |
My guess is that the right thing to do is:
|
af82274
to
05cd23a
Compare
So this is green across the board now, but needs one more review. @QuLogic @WeatherGod I'm looking into your suggestions of inheriting from |
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.
- The doc style has changed since the original PR. Needed changes are listed below.
- For consistency, we need get/set methods and the setters should
self.stale = True
.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
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.
test coverage of the setters and getters could be enhanced....
Copy that, will add some tests to bump the coverage 🧪️ |
Please keep pinging us @astromancer I don't see any fundamental reason this can't go in for the next major release, unless anyone else is opposed.... |
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.
This seems fine. I am confused why codecov is confused. Are we sure get_path
is always called on draw
? I suppose it must be...
.transform(verts) | ||
|
||
def _recompute_path(self): | ||
# circular arc |
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.
This looks great. However, do we understand why codecov is confused by this?
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 have given up trying to understand codecov. Above it warns on a line that's part of a docstring.
Thanks @astromancer! This took a long way, but it's in finally. 🎉 |
I don't now why docs didn't build before you merged, but it broke from this. |
PR Summary
Adds an the Annulus class to the patches library. This can be used to create annular ellipses or circle patches. I include a small example below that demos the usage.
PR Checklist