8000 Merge pull request #7354 from wsilva32/fix-poly-editor-example · matplotlib/matplotlib@e794622 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit e794622

Browse files
authored
Merge pull request #7354 from wsilva32/fix-poly-editor-example
DOC: fix small error in poly_editor example
2 parents de8bc33 + 96bac89 commit e794622

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/event_handling/poly_editor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def motion_notify_callback(self, event):
141141
x, y = event.xdata, event.ydata
142142

143143
self.poly.xy[self._ind] = x, y
144+
if self._ind == 0:
145+
self.poly.xy[-1] = x, y
146+
elif self._ind == len(self.poly.xy) - 1:
147+
self.poly.xy[0] = x, y
144148
self.line.set_data(zip(*self.poly.xy))
145149

146150
self.canvas.restore_region(self.background)

0 commit comments

Comments
 (0)
0