Commit 8ad5c1de authored by Damien Naudet's avatar Damien Naudet

Adding an invisible border to keep aspect between two plots that dont have the...

Adding an invisible border to keep aspect between two plots that dont have the same number of points.
parent 5f724064
...@@ -89,6 +89,16 @@ class DropPlotWidget(XsocsPlot2D): ...@@ -89,6 +89,16 @@ class DropPlotWidget(XsocsPlot2D):
scan_x = h5f.scan_x(entry) scan_x = h5f.scan_x(entry)
scan_y = h5f.scan_y(entry) scan_y = h5f.scan_y(entry)
xBorder = np.array([scan_x.min(), scan_x.max()])
yBorder = np.array([scan_y.min(), scan_y.max()])
self.addCurve(xBorder,
yBorder,
linestyle=' ',
symbol='.',
color='white',
legend='__border',
z=-1)
self.__legend = self.setPlotData(scan_x, scan_y, data) self.__legend = self.setPlotData(scan_x, scan_y, data)
self.setGraphTitle(result + '[' + FitH5QAxis.axis_names[q_axis] + ']') self.setGraphTitle(result + '[' + FitH5QAxis.axis_names[q_axis] + ']')
......
...@@ -284,9 +284,19 @@ class FitResultNode(FitProcessNode): ...@@ -284,9 +284,19 @@ class FitResultNode(FitProcessNode):
x = fitH5.scan_x(self.entry) x = fitH5.scan_x(self.entry)
y = fitH5.scan_y(self.entry) y = fitH5.scan_y(self.entry)
xBorder = np.array([x.min(), x.max()])
yBorder = np.array([y.min(), y.max()])
data = fitH5.get_qx_result(self.entry, data = fitH5.get_qx_result(self.entry,
self.process, self.process,
self.result) self.result)
plot.addCurve(xBorder,
yBorder,
linestyle=' ',
symbol='.',
color='white',
legend='__border',
z=-1)
plot.setPlotData(x, y, data) plot.setPlotData(x, y, data)
pixmap = plot.toPixmap() pixmap = plot.toPixmap()
self.setData(1, pixmap, Qt.Qt.DecorationRole) self.setData(1, pixmap, Qt.Qt.DecorationRole)
...@@ -295,6 +305,13 @@ class FitResultNode(FitProcessNode): ...@@ -295,6 +305,13 @@ class FitResultNode(FitProcessNode):
data = fitH5.get_qy_result(self.entry, data = fitH5.get_qy_result(self.entry,
self.process, self.process,
self.result) self.result)
plot.addCurve(xBorder,
yBorder,
linestyle=' ',
symbol='.',
color='white',
legend='__border',
z=-1)
plot.setPlotData(x, y, data) plot.setPlotData(x, y, data)
pixmap = plot.toPixmap() pixmap = plot.toPixmap()
self.setData(2, pixmap, Qt.Qt.DecorationRole) self.setData(2, pixmap, Qt.Qt.DecorationRole)
...@@ -303,7 +320,15 @@ class FitResultNode(FitProcessNode): ...@@ -303,7 +320,15 @@ class FitResultNode(FitProcessNode):
data = fitH5.get_qz_result(self.entry, data = fitH5.get_qz_result(self.entry,
self.process, self.process,
self.result) self.result)
plot.addCurve(xBorder,
yBorder,
linestyle=' ',
symbol='.',
color='white',
legend='__border',
z=-1)
plot.setPlotData(x, y, data) plot.setPlotData(x, y, data)
pixmap = plot.toPixmap() pixmap = plot.toPixmap()
self.setData(3, pixmap, Qt.Qt.DecorationRole) self.setData(3, pixmap, Qt.Qt.DecorationRole)
qApp.processEvents() qApp.processEvents()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment