Skip to content

The user can't revert to linear scale after setting the scale to "Log" or "Square root" on an unsupported dataset #1761

@ckuenzle

Description

@ckuenzle

Describe the bug

After switching to "Log" or "Square root" scale on an unsupported dataset, the scale selector disappears, making it impossible to reset the scale.

To Reproduce

  1. Create a dataset that only contains negative values (e. g. a 2D matrix).
    Example Python code:
import h5py

with h5py.File("test.h5", "w") as hdf5_file:
    hdf5_file.create_dataset("positive_matrix", data=[[1, 2], [3, 4]])
    hdf5_file.create_dataset("mixed_matrix", data=[[-1, 2], [3, -4]])
    hdf5_file.create_dataset("negative_matrix", data=[[-1, -2], [-3, -4]])
  1. Open that dataset as a line plot or heatmap.

Image

  1. Change the scale to "Log" or "Square root"

Image

  1. Now we get an error indicating our dataset cannot be displayed: "Expected domain compatible with log scale". This is expected behaviour, as the logarithm and square root of a negative number are undefined (at least in the real number space). However, the dropdown selector that is needed to revert to the linear scale is gone. The only way I found to get the linear scale back is to open another dataset that contains positive values.

Image

Expected behaviour

Keep displaying the scale selector even if a dataset contains unsupported data.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions