About epochs plotting

  • MNE version: 1.3.1
  • operating system: e.g. macOS Ventura 13.1
  • Python version: 3.8.16

Hi all,

I’m trying to use epoch.plot() on the data I read in as numpy array. After I generated events, when I plotted, all events showed together at each marked place instead of one of them showing up. I still haven’t figured out why it happened. Could anyone help me out? Many thanks! Below is part of my code.

# data.shape = (73, 64, 9943) where there are 73 epochs, 64 channels, 9943 time stamps
# labels are the events. Its shape is (73,)
events = np.column_stack((np.arange(data.shape[0]),
                          np.zeros(data.shape[0], dtype=int),
                          labels))
event_dict = dict(left=1, right=2, up=3, down=4)

epochs = mne.EpochsArray(data, info, tmin=-0.5, events=events, event_id=event_dict)
epochs.plot(show_scrollbars=False, events=events, event_id=event_dict, scalings='auto')

And this is what I got with this code:

Thanks again!