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

matplotlib - make figure.autolayout the default? #8578

Open
2 tasks
Tom-Willemsen opened this issue Nov 23, 2024 · 0 comments
Open
2 tasks

matplotlib - make figure.autolayout the default? #8578

Tom-Willemsen opened this issue Nov 23, 2024 · 0 comments

Comments

@Tom-Willemsen
Copy link
Contributor

Tom-Willemsen commented Nov 23, 2024

Feature Description

As a user I'd like matplotlib plots to make an attempt to display all information that has been plotted, even if the plot is quite small.

This can already be done with matplotlib rcParams global configuration which all mpl plots obey, e.g.:

import matplotlib
matplotlib.rcParams["figure.autolayout"] = True
matplotlib.rcParams["font.size"] = 8

Font size setting is just to give the plots a bit more space when stacked 3-up vertically, gives a comparable font size to scripting window. figure.autolayout gets matplotlib to attempt to squeeze the plot into the available space, generally it does an ok job.

Consider whether we want the GUI to set these, or similar, matplotlib params by default at startup - or whether we push this responsibility down to beamline-level configuration.

Advantages:

  • most plots will display sensibly with minimal end-user configuration

Disadvantages:

  • Might be surprising to some users if we override mpl's own defaults.
    • Counterargument: we know that our plot windows will regularly end up quite small compared to "normal" mpl backends, so maybe an explicit non-default configuration is justifiable.
  • If we're not careful about doing this early enough we might accidentally overwrite beamline-local configuration that has already been done by scientists
    • Even if we don't overwrite keys which they've set in rcParams, we might be conflicting with explicit layouts they've set up. But I don't know how common (if at all) that is in practice.

Explanation

Consider whether we want the GUI to set these matplotlib params by default at startup.

Additional Information

Consider whether we want the GUI to set these matplotlib params by default at startup.

Acceptance Criteria

  • Consider whether we want the GUI to set these matplotlib params by default at startup.

How to Review

  • Has the developer considered whether we want the GUI to set these matplotlib params by default at startup.

Time in recording of planning meeting: 00h36m 2024/11/28

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

No branches or pull requests

2 participants