You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the scroll of the mouse (even without mpl_connect("scroll_event")), the GUI crash. I want to modify the scroll_event function to zoom/dezoom. I already did this in my previous GUI in which it works well.
BUT, no crash with the minimalist example:
import matplotlib.pyplot as plt
plt.figure()
plt.show()
This example is from my real GUI in which I promote a widget in QtDesigner as MPL_Widget_solo.
Code for reproduction
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import sys
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class MyMplCanvas(FigureCanvas):
def __init__(self, parent=None):
self.fig = Figure()
FigureCanvas.__init__(self, self.fig)
FigureCanvas.setSizePolicy(self,
QSizePolicy.Expanding,
QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
class MPL_Widget_solo(QWidget):
def __init__(self, parent = None):
QWidget.__init__(self, parent)
self.canvas = MyMplCanvas()
self.vbox = QVBoxLayout()
self.vbox.addWidget(self.canvas)
self.setLayout(self.vbox)
class Ui_Form(object):
def setupUi(self, Form):
self.gridLayout = QGridLayout(Form)
self.widget = MPL_Widget_solo(Form)
self.gridLayout.addWidget(self.widget, 0, 0, 1, 1)
class Plot_Widget(QWidget, Ui_Form):
def __init__(self, parent=None):
super(Plot_Widget, self).__init__(parent)
self.setupUi(self)
if __name__ == "__main__":
app = QApplication(sys.argv)
plot = Plot_Widget()
plot.show()
sys.exit(app.exec_())
Actual outcome
`Process finished with exit code 1`
Expected outcome
I wish to modify the scroll event to zoom/dezoom (already done in other GUI in which it works).
Matplotlib version
Operating system: windows 7 Pro
Matplotlib version: 2.1.0 (installed via anaconda)
Matplotlib backend: Qt5Agg
Python version: 3.6
Other libraries: PyQt5
The text was updated successfully, but these errors were encountered:
Bug report
Bug summary
When I use the scroll of the mouse (even without mpl_connect("scroll_event")), the GUI crash. I want to modify the scroll_event function to zoom/dezoom. I already did this in my previous GUI in which it works well.
BUT, no crash with the minimalist example:
This example is from my real GUI in which I promote a widget in QtDesigner as MPL_Widget_solo.
Code for reproduction
Actual outcome
Expected outcome
I wish to modify the scroll event to zoom/dezoom (already done in other GUI in which it works).
Matplotlib version
The text was updated successfully, but these errors were encountered: