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

silx.gui.plot.PlotWidget: do not reset zoom when changing axes scales #3862

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Jun 15, 2023

This PR replace the previous unconditional resetZoom when switching plot axes scales to one that tries to preserve axis limits as much as possible:

  • When switching from "log" to "linear" scale, limits are not updated
  • When switching from "linear" to "log" scale:
    • Only the axis that has a scale change is updated.
    • If limits are positive, they are kept
    • If min limit is negative, the data range is used for setting it and the max value is kept if positive and having data below it.

closes #2825

@t20100 t20100 added this to the 2.0.0 milestone Jun 15, 2023
@t20100 t20100 requested a review from vallsv June 15, 2023 12:50
@vallsv vallsv merged commit 4bff365 into silx-kit:main Jun 16, 2023
@t20100 t20100 deleted the plot-no-resetzoom-on-axis-scale-change branch June 16, 2023 08:55
@t20100 t20100 mentioned this pull request Jun 16, 2023
t20100 added a commit to t20100/silx that referenced this pull request Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[plot] Do not change resetZoom when changing the log scale
2 participants