Obtaining scalings from open figure.

  • MNE version: 0.24.0
  • macOS 11.6.1

I’ve posted several questions the past year or so about a GUI I’m writing, which requires I obtain quantities from an open EEG raw plot. These are used for calculations when the user presses a button or selects an option from a pull-down window. For example,


retrieves the list of currently labelled bad channels.

From looking closely at _mpl_figure.py in mne/viz, I see that

fig.mne.t_start - fig.mne.first_time

retrieves the starting time of the currently viewed time interval.

I’ve also added a couple lines to _mpl_figure.py so that I can recover the location of a marked segment.

I’m trying to do the same to retrieve the current scalings. Specifically, in my GUI, the user will view a raw plot, select a subset of channels and adjust the scalings via the + and - keys. They then press a “plot selected” button, which will yield a new plot with only the selected channels and using the updated scalings.

The selected channels feature works fine–it’s a matter of the scalings. I thought these values are stored in _mpl_figure.py as the dictionary fig.mne.scalings

However, it appears their values are not being updated. When the user presses the “plot selected”
button, the dictionary does not change from

fig.mne.scalings={'mag': 1e-12, 'grad': 4e-11, 'eeg': 5e-05, ...}

Most of these values are the default ones described under raw.plot

So, the question I’m ultimately asking is how I can recover the current scalings dictionary with the raw plot figure still open.

I hope this makes sense.