Skip to content

Enlarging time range in raw.plot doesn't draw new annotations #8686

@cbrnr

Description

@cbrnr

Here's a simple example to reproduce:

import numpy as np
import mne

fs = 500
n_chans = 10
data = np.random.randn(n_chans, fs * 100) * 5e-6
info = mne.create_info(n_chans, fs, "eeg")
raw = mne.io.RawArray(data, info)
raw.annotations.append(onset=[1, 5, 9, 12, 15, 19],
                       duration=[2, 5, 3, 3, 5, 3],
                       description=["A1", "A1", "B2", "C3", "A1", "B2"])
raw.plot(n_channels=n_chans)

Once the plot window is open, increase the time window and notice that annotations outside the initial time window are not drawn. Here's what the plot looks like after increasing the window 13 times (notice that annotations from 10s are not drawn, but the overview bar still shows them):

Screen Shot 2020-12-30 at 16 08 50

@drammock do you have time to take a look?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions