Skip to content

Commit ce5ba15

Browse files
committed
Fix ROI editor not preserving non-linear axis scales of source plot
Closes #315
1 parent 84473d8 commit ce5ba15

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

datalab/gui/panel/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,6 +2980,15 @@ def get_roi_editor_output(
29802980
source_panel=self,
29812981
size=self.get_dialog_size(),
29822982
)
2983+
# Propagate the source plot axis scales (e.g. log) to the ROI editor
2984+
# so that signals/images displayed with non-linear scales keep the same
2985+
# representation in the ROI editor dialog (see issue: ROI editor was
2986+
# always opening with default lin-lin scales).
2987+
src_plot = self.plothandler.plot
2988+
roi_editor.get_plot().set_scales(
2989+
src_plot.get_axis_scale("bottom"),
2990+
src_plot.get_axis_scale("left"),
2991+
)
29832992
if exec_dialog(roi_editor):
29842993
return roi_editor.get_roieditor_results()
29852994
return None

0 commit comments

Comments
 (0)