threads __init__, pyside6->pyqt6
This commit is contained in:
@@ -5,7 +5,7 @@ matplotlib.use("QtAgg")
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from matplotlib.figure import Figure
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class graph(FigureCanvas):
|
||||
@@ -25,7 +25,7 @@ class GraphWidget(QtWidgets.QWidget):
|
||||
self.toolbar = NavigationToolbar(self.graph, self)
|
||||
# set legend
|
||||
self.graph.axes.legend(legend_labels, loc="upper left")
|
||||
#set x-axis text to be slanted
|
||||
# set x-axis text to be slanted
|
||||
self.graph.axes.set_xticklabels(data["x"], rotation=45, ha="right")
|
||||
# set the layout
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
@@ -49,3 +49,4 @@ if __name__ == "__main__":
|
||||
widget = GraphWidget(data=data, legend_labels=["+", "-"])
|
||||
widget.show()
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user