Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d43b105

Browse files
committed
MNT: apply no-op exit for non-visible artists
1 parent d1e2a20 commit d43b105

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/patches.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,8 @@ def draw(self, renderer):
16471647
"""
16481648
if not hasattr(self, 'axes'):
16491649
raise RuntimeError('Arcs can only be used in Axes instances')
1650+
if not self.get_visible():
1651+
return
16501652

16511653
self._recompute_transform()
16521654

@@ -1661,7 +1663,6 @@ def theta_stretch(theta, scale):
16611663
y = np.sin(theta)
16621664
stheta = np.rad2deg(np.arctan2(scale * y, x))
16631665
# arctan2 has the range [-pi, pi], we expect [0, 2*pi]
1664-
16651666
return (stheta + 360) % 360
16661667

16671668
theta1 = self.theta1

lib/matplotlib/tests/test_patches.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ def test_rotated_arcs():
535535
for prescale, centers in zip((1 - .0001, (1 - .0001) / np.sqrt(2)),
536536
(on_axis_centers, diag_centers)):
537537
for j, (x_sign, y_sign) in enumerate(centers, start=k):
538-
print(j)
539538
a = mpatches.Arc(
540539
(x_sign * scale * prescale,
541540
y_sign * scale * prescale),

0 commit comments

Comments
 (0)