0

When I use plt.waitforbuttonpress(), it behaves as expected, but any click to the plot is getting dispatched as this "button press", so using plot GUI tools like zooming tool is not possible. Is there an alternative to waitforbuttonpress that enables you to freeze a window in plt.ion() mode until certain input from user in received and not clear the plot in until explicit cla() or clf() call, and enables you to use these gui tools?

Ben Usman
  • 7,969
  • 6
  • 46
  • 66

1 Answers1

3

Surprisingly, this works:

while not plt.waitforbuttonpress(): pass

This way it will only proceed ones the user presses a key on a keyboard and mouse clicks processed as usual.

Ben Usman
  • 7,969
  • 6
  • 46
  • 66