I am trying to embed matplotlib in a Qt interface using Pyside2. I want to use 'imshow' to display an image that I can zoom into using the scrollwheel and click on as well. To connect the scrollwheel and mouse, I am using:
self.fig.canvas.mpl_connect('button_press_event', self.mouseClick)
self.fig.canvas.mpl_connect('scroll_event', self.wheelEvent)
If for the event handlers I use:
def wheelEvent(self, event):
print(event)
def mouseClick(self, event):
print(event)
When I run this, and then scroll and click, the output I get is:
button_press_event: xy=(94, 199) xydata=(99.99197230814553, 134.93602887023127) button=1 dblclick=False inaxes=AxesSubplot(0.125,0.290018;0.775x0.409964)
<PySide2.QtGui.QWheelEvent object at 0x7f92e3359a50>
So my question is, why in the one case am I getting a PySide event and in the other a matplotlib button_press_event? What I was expecting was to get a scroll_event.
Many thanks!