-
Notifications
You must be signed in to change notification settings - Fork 0
/
matplotlib_pyqt.py
58 lines (42 loc) · 1.23 KB
/
matplotlib_pyqt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
"""
Module implementing MainWindow.
"""
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow, QApplication
from Ui_matplotlib_pyqt import Ui_MainWindow
351
class MainWindow(QMainWindow, Ui_MainWindow):
"""
Class documentation goes here.
"""
def __init__(self, parent=None):
"""
Constructor
@param parent reference to the parent widget
@type QWidget
"""
super(MainWindow, self).__init__(parent)
self.setupUi(self)
self.matplotlibwidget_dynamic.setVisible(False)
self.matplotlibwidget_static.setVisible(False)
@pyqtSlot()
def on_pushButton_clicked(self):
"""
Slot documentation goes here.
2313 """
self.matplotlibwidget_static.setVisible(True)
self.matplotlibwidget_static.mpl.start_static_plot()
@pyqtSlot()
def on_pushButton_2_clicked(self):
"""
Slot documentation goes here.
"""
self.matplotlibwidget_dynamic.setVisible(True)
self.matplotlibwidget_dynamic.mpl.start_dynamic_plot()
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
ui = MainWindow()
ui.show()
sys.exit(app.exec_())