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

Skip to content

Commit 6757719

Browse files
authored
Merge pull request #8305 from anntzer/blocking-input-for-unmanaged-figures
In ginput(), don't call show() if we can't.
2 parents fc6a7ba + a62e8be commit 6757719

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/blocking_input.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def __call__(self, n=1, timeout=30):
101101
self.events = []
102102
self.callbacks = []
103103

104-
# Ensure that the figure is shown
105-
self.fig.show()
104+
if hasattr(self.fig, "manager"):
105+
# Ensure that the figure is shown, if we are managing it.
106+
self.fig.show()
106107

107108
# connect the events to the on_event function call
108109
for n in self.eventslist:

0 commit comments

Comments
 (0)