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

Skip to content

Commit b6134dc

Browse files
daniel-s-ingramQuLogic
authored andcommitted
Remove arc based on gid
1 parent 518b662 commit b6134dc

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
@@ -66,13 +66,10 @@ def draw_arc_between_vectors(ax, vec1, vec2):
6666
height /= norm
6767
theta1 = get_vector_angle(vec1)
6868
theta2 = get_vector_angle(vec2)
69-
arc = mpatches.Arc((0, 0), width, height, theta1=theta1, theta2=theta2)
70-
try:
71-
ax.patches[0].remove()
72-
except:
73-
pass
69+
arc = mpatches.Arc(
70+
(0, 0), width, height, theta1=theta1, theta2=theta2, gid="angle_arc")
71+
[p.remove() for p in ax.patches if p.get_gid() == "angle_arc"]
7472
ax.add_patch(arc)
75-
print(ax.patches[0].gid)
7673

7774

7875
def fig_resize(event):

0 commit comments

Comments
 (0)