Skip to content

Conversation

@jellybean2004
Copy link
Contributor

Description

As suggested by @krzywon in PR #3806, the 'Stack Plots' checkbox has been added as a global user preference. Also adds this to the preferences documentation.

Fixes #3830

How Has This Been Tested?

Manually tested functionality.

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

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)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

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

Copilot AI review requested due to automatic review settings January 8, 2026 15:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a global user preference for the "Stack Plots" functionality when using slicers in 2D plots. Previously, this was hardcoded as True in the Plotter2D class; now it can be configured by users through the Preferences panel.

Key Changes:

  • Added STACK_PLOTS configuration parameter with a default value of True
  • Integrated the preference into the Plotting Preferences UI panel
  • Updated the preferences documentation to describe the new setting

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/sas/system/config/config.py Adds STACK_PLOTS configuration parameter with default value True and descriptive comments
src/sas/qtgui/Utilities/Preferences/PlottingPreferencesWidget.py Adds checkbox widget for stack plots preference, includes signal handling and config restoration
src/sas/qtgui/Plotting/Plotter2D.py Changes stackplots initialization from hardcoded True to use config.STACK_PLOTS
src/sas/qtgui/MainWindow/media/preferences_help.rst Documents the new preference option with description of its behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@krzywon krzywon left a comment

Choose a reason for hiding this comment

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

Overall, the code looks good. Haven't tested functionality.

Comment on lines +45 to +47
**Stack plots when using slicers**: When selected, multiple plots generated using slicers will be added to the same plot
window, each with its own legend entry. When not selected, each plot will open in its own window. *persistent*

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is documentation on the plot stacking, a link to it from here would be helpful.

@butlerpd butlerpd requested a review from JoGaudet January 13, 2026 14:38
Copy link

@JoGaudet JoGaudet left a comment

Choose a reason for hiding this comment

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

I tested the functionality and it seems to work as intended. We can now see the option to click "Stack plots when using slicers", which automatically allow (or disallowed) the stacking of multiple slicers into the same plot. I tried the global preference and it works as intended for all slicers available.

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 'stacking' as a global preference

4 participants