Skip to content

ROI editor dialog ignores non-linear axis scales of the source plot #315

Description

@PierreRaybaut

Description

When opening the ROI editor dialog (graphical edition of Regions of Interest) on a signal whose plot uses a non-linear axis scale (e.g. log on X and/or Y), the dialog always opens with the default linear-linear scales. The signal is therefore not displayed with the same representation as in the main panel, which is misleading and makes ROI definition impractical (especially on signals that span several decades).

The same issue applies to the image ROI editor when the image panel is configured with a non-linear axis scale.

Steps to reproduce

  1. Open DataLab.
  2. Create or load a signal (e.g. sin(x) + 1 over [0, 100]).
  3. In the signal panel, switch the Y axis to log scale (axis context menu / "Lin/Log scales" tool).
  4. Open Analysis > Edit regions of interest... (or "Extract regions of interest...").
  5. Observe the plot in the ROI editor dialog.

Expected behavior

The ROI editor dialog should display the signal using the same axis scales as the source panel (log Y in the example above).

Actual behavior

The ROI editor dialog always uses linear-linear scales, regardless of the source panel configuration.

Root cause

In datalab/gui/panel/base.py, BaseDataPanel.get_roi_editor_output() builds the ROI editor dialog from self.plothandler.get_plot_options(). The PlotOptions dataclass (PlotPy) does not carry the axis scale information (xscale / yscale), so the dialog is created with PlotPy's default linear-linear scales.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions