Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4ac4080

Browse files
committed
Fixesmatplotlib#3 A spectrum figure closing was not triggering the closing cascade
1 parentf0aff64 commit4ac4080

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎lib/drawing/spectrum.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def __init__(self):
5353

5454
defcreate_figure(self):
5555
self.figure=utils.create_figure()
56+
utils.on_window_close(self.figure,self.close)
5657

5758
defcreate_left_axis(self):
5859
self.left_ax=self.figure.add_subplot(111)
@@ -161,13 +162,12 @@ def update(self):
161162
self.ax.figure.canvas.draw()
162163

163164
defclose(self):
164-
self.ax.lines.remove(self.line)
165+
ifself.lineinself.ax.lines:
166+
self.ax.lines.remove(self.line)
165167
self.coordinates.disconnect(self.update)
166168
try:
167169
self.ax.figure.canvas.draw()
168170
except:
169171
pass
170172

171-
172-
173173
plt.show()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp