8000 Add an Annulus patch class by astromancer · Pull Request #9888 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 18 commits into from
Apr 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
'add Annulus patch for making elliptical annuli'
  • Loading branch information
astromancer committed Mar 3, 2021
commit a05fb1e228eb56aa8a00431da4143c253ae1fdfe
5 changes: 1 addition & 4 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,8 +1608,6 @@ def __init__(self, xy, r, width, angle=0.0, **kwargs):
self.width = width
self.angle = angle
self._path = None
# Note: This cannot be calculated until this is added to an Axes
self._patch_transform = transforms.IdentityTransform()

def _transform_verts(self, verts, a, b):
center = (self.convert_xunits(self.center[0]),
Expand All @@ -1624,11 +1622,10 @@ def _transform_verts(self, verts, a, b):
return tr.transform(verts)

def _recompute_path(self):

# circular arc
Copy link
Member

Choose a reason for hiding this comment

< 90A6 p class="mb-3"> 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?

Copy link
Member

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.

arc = Path.arc(0, 360)

# annulus needs to draw the outer ring
# annulus needs to draw an outer ring
# followed by a reversed and scaled inner ring
a, b, w = self.a, self.b, self.width
v1 = self._transform_verts(arc.vertices, a, b)
Expand Down
0