Skip to content

Channel traces disappear for raw.plot(scalings='auto') when automatic scaling returns very large values #383

Description

@karahanyilmazer

Description of the problem

Plotting my data with raw.plot(scalings='auto') works correctly at first, but any change to the visible time span like scrolling, zooming in or out, or adjusting the window length causes all traces to vanish. Changing how many channels are shown doesn't trigger it. Displaying only a single channel still produces a plot, though only within a very tight amplitude range, with the lower and higher ends being clipped. The problem doesn't appear when I leave scalings at its default, and I can't reproduce it with MNE's sample dataset. On the dataset that shows the issue, scalings='auto' yields an unusually large scale (≈4.6e8 µV), pointing to an automatic scaling value that is far off and likely disrupting the viewer's rescaling.

Steps to reproduce

import mne

# Using sample data
# =============================================================================
sample_data_folder = mne.datasets.sample.data_path()
raw_file = sample_data_folder / "MEG" / "sample" / "sample_audvis_filt-0-40_raw.fif"
raw = mne.io.read_raw_fif(raw_file)



# Using my data
# =============================================================================
# import pyxdf

# data_file = "080825.xdf"
# montage_file = "CLA-32.bvef"
# head_size = 0.075

# # Load XDF data
# streams, header = pyxdf.load_xdf(data_file)
# data = streams[0]["time_series"].T
# fs = streams[0]["info"]["nominal_srate"][0]

# # Montage and info
# montage = mne.channels.read_custom_montage(montage_file, head_size=head_size)
# info = mne.create_info(ch_names=channels, sfreq=fs, ch_types="eeg")
# info.set_montage(montage)

# # Create Raw object
# raw = mne.io.RawArray(data, info)

raw.plot(scalings='auto')

Expected results

Traces remain visible when scrolling or changing zoom level, and amplitude scaling adapts normally.

Actual results

Traces disappear whenever the visible time span is modified. A single-channel zoom displays only within a very restricted amplitude window. Using default scaling (raw.plot()) avoids the issue. The problem persists across multiple versions of MNE, PyQt6, and PySide6. A screen recording illustrates the behaviour:

Image

Additional information

Platform             macOS-26.1-arm64-arm-64bit-Mach-O
Python               3.13.7 (main, Aug 14 2025, 11:12:11) [Clang 17.0.0 (clang-1700.0.13.3)]
Executable           /Users/karahanyilmazer/Coding/python/venvs/neurofeedback_13/bin/python
CPU                  Apple M4 Pro (12 cores)
Memory               48.0 GiB

Core
├☒ mne               1.10.0 (outdated, release 1.11.0 is available!)
├☑ numpy             2.3.5 (unknown linalg bindings)
├☑ scipy             1.16.3
└☑ matplotlib        3.10.7 (backend=QtAgg)

Numerical (optional)
├☑ sklearn           1.7.2
├☑ pandas            2.3.3
└☐ unavailable       numba, nibabel, nilearn, dipy, openmeeg, cupy, h5io, h5py

Visualization (optional)
├☑ qtpy              2.4.3 (PySide6=6.10.1)
├☑ pyqtgraph         0.14.0
├☑ mne-qt-browser    0.7.4
└☐ unavailable       pyvista, pyvistaqt, vtk, ipympl, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify

Ecosystem (optional)
├☑ mne-icalabel      0.8.1
└☐ unavailable       mne-bids, mne-nirs, mne-features, mne-connectivity, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv

To update to the latest supported release version to get bugfixes and improvements, visit https://mne.tools/stable/install/updating.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions