mirror of
https://github.com/Athemis/PyDSF.git
synced 2025-04-05 14:46:03 +00:00
Added NavigationToolbar to plots.
This commit is contained in:
parent
5a17c960c2
commit
9d1e3d8fa2
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
from PyQt5 import QtWidgets
|
||||
from PyQt5 import QtWidgets, QtGui, QtCore
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QTAgg as NavigationToolbar
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from matplotlib.figure import Figure
|
||||
|
||||
class MplCanvas(FigureCanvas):
|
||||
|
@ -20,6 +20,8 @@ class MplWidget(QtWidgets.QWidget):
|
|||
QtWidgets.QWidget.__init__(self, parent)
|
||||
|
||||
self.canvas = MplCanvas()
|
||||
self.ntb = NavigationToolbar(self.canvas, self)
|
||||
self.vbl = QtWidgets.QVBoxLayout()
|
||||
self.vbl.addWidget(self.canvas)
|
||||
self.vbl.addWidget(self.ntb)
|
||||
self.setLayout(self.vbl)
|
Loading…
Add table
Reference in a new issue