Matplotlib Event Listeners Not Funcitoning In Pyqt Widget
I have a library of draggable matplotlib objects that I'm trying to utilize with a PyQt5 GUI. The objects' event listeners function correctly in a standalone matplotlib figure wind
Solution 1:
Turns out that the problem are not drag events but instead your minidrag.DragRectangle
instance just being garbage collected (while the canvas remains showing the rectangle at its original position).
As a fix you can set the rectangle as an instance variable:
self.rect = minidrag.DragRectangle(ax, (0, 0), 2, 1)
(Tested with Python2.7 and PyQt4.)
Post a Comment for "Matplotlib Event Listeners Not Funcitoning In Pyqt Widget"