Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 2270b02

Browse files
Added another viewing capability for PL line scans after fitting
1 parent 872da74 commit 2270b02

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

PythonGUI_apps/Spectrum_analysis/Spectra_plot_fit.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -649,18 +649,32 @@ def plot_fit_scan(self):
649649
param_selection = str(self.ui.comboBox.currentText())
650650
self.img = np.reshape(eval(param_selection), newshape)
651651

652-
if self.ui.use_raw_scan_settings.isChecked():
653-
self.ui.fit_scan_viewbox.setImage(self.img, scale=
654-
(self.x_step_size,
655-
self.y_step_size))
656-
scale = pg.ScaleBar(size=2,suffix='um')
657-
scale.setParentItem(self.ui.fit_scan_viewbox.view)
658-
scale.anchor((1, 1), (1, 1), offset=(-30, -30))
659-
self.ui.fit_scan_viewbox.view.sigRangeChanged.connect(lambda: updateDelay(scale, 10))
660-
else:
661-
self.ui.fit_scan_viewbox.setImage(self.img)
652+
if num_y == 1:
653+
x = np.linspace(0, self.x_scan_size, num_x)
654+
self.graph_layout=pg.GraphicsLayoutWidget()
655+
self.plot = self.graph_layout.addPlot(title="Line Scan")
656+
self.plot.plot(x, self.img[:,0], pen="r")
657+
self.graph_layout.show()
658+
elif num_x == 1:
659+
y = np.linspace(0, self.y_scan_size, num_y)
660+
self.graph_layout=pg.GraphicsLayoutWidget()
661+
self.plot = self.graph_layout.addPlot(title="Line Scan")
662+
self.ui.plot.plot(y, self.img[0,:], pen="r")
663+
self.graph_layout.show()
662664

663-
self.ui.fit_scan_viewbox.view.invertY(False)
665+
else:
666+
if self.ui.use_raw_scan_settings.isChecked():
667+
self.ui.fit_scan_viewbox.setImage(self.img, scale=
668+
(self.x_step_size,
669+
self.y_step_size))
670+
scale = pg.ScaleBar(size=2,suffix='um')
671+
scale.setParentItem(self.ui.fit_scan_viewbox.view)
672+
scale.anchor((1, 1), (1, 1), offset=(-30, -30))
673+
self.ui.fit_scan_viewbox.view.sigRangeChanged.connect(lambda: updateDelay(scale, 10))
674+
else:
675+
self.ui.fit_scan_viewbox.setImage(self.img)
676+
677+
self.ui.fit_scan_viewbox.view.invertY(False)
664678

665679
except Exception as e:
666680
self.ui.result_textBrowser2.append(str(e))

0 commit comments

Comments
 (0)