I plotted a graph with matplotlib, and I want to interact with it when I clicked some of the points. I have many points overlapping on each other.
def foo():
plist = list()
data = data_generator()
for ind in range(0, len(data)):
x_plot, y_plot = generator()
paths = ax.plot(x_plot, y_plot, alpha=alpha)
plist.append(paths[0])
class AbstractPlotPage(tk.Frame):
def __init__():
self.paths = foo()
self.canvas = FigureCanvasTkAgg(f, self)
self.canvas.mpl_connect('pick_event', self.on_pick)
self.canvas.show()
def on_pick():
print('test')
The thing is, I noticed matplotlib does not run the on_pick once for all the overlapped points. But it runs once for a single points then run it again.
So is there a way to check when the event queue is done? Or how can I watch this event queue?