Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ckuenzle opened this issue Feb 21, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@ckuenzle
Copy link

ckuenzle commented Feb 21, 2025

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

@ckuenzle ckuenzle added the bug Something isn't working label Feb 21, 2025
@loichuder
Copy link
Member

👍

I actually encountered this myself a few times but forgot to write it down...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants