Skip to content

Commit f4a63d5

Browse files
Remove arc based on gid
1 parent 2688dd4 commit f4a63d5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

examples/lines_bars_and_markers/angle_arc.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,10 @@ def draw_arc_between_vectors(ax, vec1, vec2):
6767
height /= norm
6868
theta1 = get_vector_angle(vec1)
6969
theta2 = get_vector_angle(vec2)
70-
arc = mpatches.Arc((0, 0), width, height, theta1=theta1, theta2=theta2)
71-
try:
72-
ax.patches[0].remove()
73-
except:
74-
pass
70+
arc = mpatches.Arc(
71+
(0, 0), width, height, theta1=theta1, theta2=theta2, gid="angle_arc")
72+
[p.remove() for p in ax.patches if p.get_gid() == "angle_arc"]
7573
ax.add_patch(arc)
76-
print(ax.patches[0].gid)
7774

7875

7976
def fig_resize(event):

0 commit comments

Comments
 (0)