mne-tools / mne-tools/mne-python

Browser figure ignores `matplotlib.rcParams["figure.figsize"]`

Open
#11,233 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

I have another problem with the way MNE plotting works (or maybe it's just me doing things the wrong way). It seems like we ignore the figure.figsize RC parameter, so I can't e.g. customize the created figure size with this mechanism. Which BTW is pretty important, because it is used in Quarto as a cell option for example.

It seems like the only way to set the figure size (in this particular case) is via the MNE_BROWSE_RAW_SIZE environment variable. This can lead to surprising results, because it leads to non-reproducible results when this setting depends e.g. on the presence of an entry in the (hidden) MNE config file.

Would it be possible to somehow use matplotlib.rcParams["figure.figsize"] to control our browser figure size? I'm not sure if this problem also applies to other kinds of figures as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how browser figures are created and where MNE_BROWSE_RAW_SIZE is read, then compare that behavior with matplotlib.rcParams["figure.figsize"]. The change is complete when the browser figure can follow the rcParam without relying on hidden MNE configuration; the issue does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.