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

2904 graph is not getting the correct axis #2967

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

lucas-wilkins
Copy link
Contributor

Plots now get their default scaling from the data given to them. Hope this is the right solution and I've not missed anything.

Fixes #2904

@lucas-wilkins lucas-wilkins added the SasView 6.0.0 Required for 6.0.0 release label Jul 18, 2024
@lucas-wilkins lucas-wilkins linked an issue Jul 18, 2024 that may be closed by this pull request
@krzywon
Copy link
Contributor

krzywon commented Jul 24, 2024

We had something like this in the past, where the plots were scaled to the data, but this can create significant issues when a single outlying data point is loaded in. I don't think moving away from built-in MPL functionality is the right answer in this case. Instead, we need to investigate why the data set used by @XaelShan is being plotted the way it is. I have the file that triggered this and will add it to the original issue.

@lucas-wilkins
Copy link
Contributor Author

I think that the reason is that there is a minimum range, and the data is very flat, matplotlib matplotlib centres on the range, but then its logged, pushing it to the top.

I did look at the data before doing this.

I don't see what the issue is with using this scaling method (I do remember people discussing before), I don't see how it would be problem with a single point, or with outliers - there are potential problems I can see with doing it naively, but scaling the range endpoints ensures that the range isn't zero, and that none of MPLs weird edge-of-plot cropping happens.

@XaelShan
Copy link
Contributor

I believe I have another dataset that also triggers this graphing problem. I will test it again and add it to the issue.

@wpotrzebowski wpotrzebowski added the Discuss At The Call Issues to be discussed at the fortnightly call label Jul 29, 2024
Copy link
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Minor stylistic comment only.

src/sas/qtgui/Plotting/Plotter.py Outdated Show resolved Hide resolved
@wpotrzebowski wpotrzebowski removed the Discuss At The Call Issues to be discussed at the fortnightly call label Aug 1, 2024
@krzywon krzywon merged commit eb7263a into release_6.0.0 Aug 2, 2024
28 checks passed
@krzywon krzywon deleted the 2904-graph-is-not-getting-the-correct-axis branch August 2, 2024 13:50
@krzywon krzywon mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SasView 6.0.0 Required for 6.0.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graph is not getting the correct axis
5 participants