diff --git a/lib/matplotlib/blocking_input.py b/lib/matplotlib/blocking_input.py index d7035221e8eb..fcafac5f3bbc 100644 --- a/lib/matplotlib/blocking_input.py +++ b/lib/matplotlib/blocking_input.py @@ -104,8 +104,9 @@ def __call__(self, n=1, timeout=30): self.events = [] self.callbacks = [] - # Ensure that the figure is shown - self.fig.show() + if hasattr(self.fig, "manager"): + # Ensure that the figure is shown, if we are managing it. + self.fig.show() # connect the events to the on_event function call for n in self.eventslist: