diff --git a/src/gui_qt/_py/fitresult.py b/src/gui_qt/_py/fitresult.py index ebb298e..5a9a4e4 100644 --- a/src/gui_qt/_py/fitresult.py +++ b/src/gui_qt/_py/fitresult.py @@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") - Dialog.resize(864, 712) + Dialog.resize(969, 974) self.gridLayout = QtWidgets.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() @@ -153,18 +153,10 @@ class Ui_Dialog(object): self.logx_box.setLayoutDirection(QtCore.Qt.RightToLeft) self.logx_box.setObjectName("logx_box") self.gridLayout_3.addWidget(self.logx_box, 2, 0, 1, 1) - self.fit_plot = PlotWidget(self.stackPage1) - self.fit_plot.setObjectName("fit_plot") - self.gridLayout_3.addWidget(self.fit_plot, 0, 0, 1, 2) + self.graphicsView = GraphicsLayoutWidget(self.stackPage1) + self.graphicsView.setObjectName("graphicsView") + self.gridLayout_3.addWidget(self.graphicsView, 0, 0, 1, 2) self.stack.addTab(self.stackPage1, "") - self.tab = QtWidgets.QWidget() - self.tab.setObjectName("tab") - self.verticalLayout = QtWidgets.QVBoxLayout(self.tab) - self.verticalLayout.setObjectName("verticalLayout") - self.resid_plot = PlotWidget(self.tab) - self.resid_plot.setObjectName("resid_plot") - self.verticalLayout.addWidget(self.resid_plot) - self.stack.addTab(self.tab, "") self.stackPage2 = QtWidgets.QWidget() self.stackPage2.setObjectName("stackPage2") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.stackPage2) @@ -232,7 +224,6 @@ class Ui_Dialog(object): self.logy_box.setText(_translate("Dialog", "logarithmic y axis")) self.logx_box.setText(_translate("Dialog", "logarithmic x axis")) self.stack.setTabText(self.stack.indexOf(self.stackPage1), _translate("Dialog", "Plot")) - self.stack.setTabText(self.stack.indexOf(self.tab), _translate("Dialog", "Residuals")) self.stack.setTabText(self.stack.indexOf(self.stackPage2), _translate("Dialog", "Statistics")) item = self.corr_tableWidget.horizontalHeaderItem(0) item.setText(_translate("Dialog", "Parameter 1")) @@ -244,4 +235,4 @@ class Ui_Dialog(object): item.setText(_translate("Dialog", "Partial Corr.")) self.stack.setTabText(self.stack.indexOf(self.stackPage3), _translate("Dialog", "Correlations")) from ..lib.forms import ElideComboBox -from pyqtgraph import PlotWidget +from pyqtgraph import GraphicsLayoutWidget diff --git a/src/gui_qt/fit/result.py b/src/gui_qt/fit/result.py index f8c79b9..7bb927b 100644 --- a/src/gui_qt/fit/result.py +++ b/src/gui_qt/fit/result.py @@ -33,6 +33,12 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog): self.graph_opts = {} self.last_idx = None + self.resid_plot = self.graphicsView.addPlot(row=0, col=0, title='Residual') + self.fit_plot = self.graphicsView.addPlot(row=1, col=0, title='Fit') + + self.graphicsView.ci.layout.setRowStretchFactor(0, 1) + self.graphicsView.ci.layout.setRowStretchFactor(1, 2) + self.resid_graph = PlotItem(x=[], y=[], symbol='o', symbolPen=None, symbolBrush=mkBrush(color=(31, 119, 180)), pen=None) @@ -41,7 +47,6 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog): pen=None) self.resid_plot.addItem(self.resid_graph) self.resid_plot.addItem(self.resid_graph_imag) - self.resid_plot.setLabel('left', 'Residual') self.data_graph = PlotItem(x=[], y=[], symbol='o', symbolPen=None, symbolBrush=mkBrush(color=(31, 119, 180)), @@ -51,7 +56,6 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog): pen=None) self.fit_plot.addItem(self.data_graph) self.fit_plot.addItem(self.data_graph_imag) - self.fit_plot.setLabel('left', 'Function') self.fit_graph = PlotItem(x=[], y=[]) self.fit_graph_imag = PlotItem(x=[], y=[]) @@ -159,7 +163,7 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog): iscomplex = res.iscomplex sub_funcs = res.sub(res.x) - for item in self.fit_plot.plotItem.items[::-1]: + for item in self.fit_plot.items[::-1]: if item not in [self.data_graph, self.data_graph_imag, self.fit_graph, self.fit_graph_imag]: self.fit_plot.removeItem(item) diff --git a/src/resources/_ui/fitresult.ui b/src/resources/_ui/fitresult.ui index cd2b130..bd81cb1 100644 --- a/src/resources/_ui/fitresult.ui +++ b/src/resources/_ui/fitresult.ui @@ -6,8 +6,8 @@ 0 0 - 864 - 712 + 969 + 974 @@ -307,17 +307,7 @@ - - - - - - - Residuals - - - - + @@ -435,7 +425,7 @@
..lib.forms
- PlotWidget + GraphicsLayoutWidget QGraphicsView
pyqtgraph