Well, that was easier than I thought! For those who are interested, I found a solution using figure.canvas.start_event_loop() and figure.canvas.stop_event_loop() .
Here is a simple example:
from matplotlib import pyplot as plt class FigEventLoopDemo(object): def __init__(self): self.fig, self.ax = plt.subplots(1, 1, num='Event loop demo') self.clickme = self.ax.text(0.5, 0.5, 'click me', ha='center', va='center', color='r', fontsize=20, picker=10)
ali_m source share