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

3157: Fix v6.0.0 plot scaling issues #3184

Open
wants to merge 25 commits into
base: release_6.0.1
Choose a base branch
from
Open

Conversation

krzywon
Copy link
Contributor

@krzywon krzywon commented Jan 14, 2025

Description

This is a lesser implementation of the work already in #3148. This fixes the plot scaling issues introduced in v6.0.0, but doesn't make as clean a separation of the data and plots as I originally hoped to make for the release.

Refs #3021 (A start for this, but doesn't fully remove the x/y transforms from PlotterData classes and still uses them in a couple of places)
Fixes #3157

How Has This Been Tested?

Tested from source on Win11. Verified the following:

  • SAS data and fits are plotted together on log/log scale
  • SAS residuals are on log/lin scale
  • SESANS data and fits are plotted together on lin/lin scale
  • SESANS residuals are on lin/lin scale
  • All residual plots (SAS and SESANS) have the +/- 3 lines
  • Polydispersity plots are on lin/in scale
  • No change to 2D plot scaling

Review Checklist:

Documentation (check at least one)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)

Licencing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@krzywon
Copy link
Contributor Author

krzywon commented Jan 14, 2025

MacOS builds failing due to notarization issue that is fixed in #3183

@butlerpd butlerpd self-requested a review January 28, 2025 14:24
@krzywon krzywon requested a review from rozyczko January 28, 2025 14:30
…-in-customize-labels-throws-an-error

Fix calls to set_xticklabels and set_yticklabels
Copy link
Member

@butlerpd butlerpd left a comment

Choose a reason for hiding this comment

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

I'm still not convinced converting to roles at this stage was/is a good idea. It is time consuming to test even because there are so many nooks and crannies but here is my best.

This is certainly behaving better than the last PR However there remain several issues which still need fixing:

  • Residuals
    • The plot now uses a linear scale for the y axis; good. However the data still seems to think it is on a log scale I think (even though it is not) and thus no negative residuals get plotted (as if the mirror images was covered over 😄) .
  • Sectors
    • Always plot log log even if the x axis is in degrees. So annual and wedge phi are incorrect. They are done correctly in 5.0.6
  • Linear plots
    • Axis default (home button) are the untransformed limits. In other words, the x and y range are based on the data Q and I(Q) not the transformed (e.g. Q^2 or Ln(I) etc). The result is that, if one is lucky, the data is squished into a tiny corner of the plot, if not, and the plot goes negative such as in the cross-sectional Guinier, the data disappear altogether!!
  • Interesting error that seems to be introduced by this PR but not sure how? but it is not present in 6.0.0.
    • When using a fitpage without any data to create a theory plot (but NOT if there is data associated with the fitpage) the following error gets thrown when hitting compute/plot (and yes, it gets thrown twice)
19:37:38 - ERROR: Traceback (most recent call last): File "sas\qtgui\MainWindow\GuiManager.py", line 1339, in deleteIntermediateTheoryPlotsByTabId File "sas\qtgui\MainWindow\DataExplorer.py", line 2085, in deleteIntermediateTheoryPlotsByTabId NameError: name 'model_id' is not defined
19:37:38 - ERROR: Traceback (most recent call last): File "sas\qtgui\MainWindow\GuiManager.py", line 1339, in deleteIntermediateTheoryPlotsByTabId File 

Things tested that do work now:

  • Polydispersity seems to work fine now
  • Show SLD seems fine
  • Other perspectives seem fine

@krzywon
Copy link
Contributor Author

krzywon commented Jan 30, 2025

  • Residuals

    • The plot now uses a linear scale for the y axis; good. However the data still seems to think it is on a log scale I think (even though it is not) and thus no negative residuals get plotted (as if the mirror images was covered over 😄) .
  • Sectors

    • Always plot log log even if the x axis is in degrees. So annual and wedge phi are incorrect. They are done correctly in 5.0.6

Both of these should be fixed now. Please check again when you are able.

  • Linear plots

    • Axis default (home button) are the untransformed limits. In other words, the x and y range are based on the data Q and I(Q) not the transformed (e.g. Q^2 or Ln(I) etc). The result is that, if one is lucky, the data is squished into a tiny corner of the plot, if not, and the plot goes negative such as in the cross-sectional Guinier, the data disappear altogether!!

I'm still looking into this. We might want to create a separate issue, since this is also happening in v6.0.0.

  • Interesting error that seems to be introduced by this PR but not sure how? but it is not present in 6.0.0.

    • When using a fitpage without any data to create a theory plot (but NOT if there is data associated with the fitpage) the following error gets thrown when hitting compute/plot (and yes, it gets thrown twice)
19:37:38 - ERROR: Traceback (most recent call last): File "sas\qtgui\MainWindow\GuiManager.py", line 1339, in deleteIntermediateTheoryPlotsByTabId File "sas\qtgui\MainWindow\DataExplorer.py", line 2085, in deleteIntermediateTheoryPlotsByTabId NameError: name 'model_id' is not defined
19:37:38 - ERROR: Traceback (most recent call last): File "sas\qtgui\MainWindow\GuiManager.py", line 1339, in deleteIntermediateTheoryPlotsByTabId File 

This error was fixed by PR #3190. I've integrated that changed into my branch so that doesn't seem to happen anymore.

@krzywon
Copy link
Contributor Author

krzywon commented Jan 30, 2025

Axis default (home button) are the untransformed limits. In other words, the x and y range are based on the data Q and I(Q) not the transformed (e.g. Q^2 or Ln(I) etc). The result is that, if one is lucky, the data is squished into a tiny corner of the plot, if not, and the plot goes negative such as in the cross-sectional Guinier, the data disappear altogether!!

I think I have this figured out now. The plot axis range was based off the original data, not the data view, which is why it was always the same value. My latest commit should hopefully fix this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants