---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-9-92c02e7b010c> in <module>
----> 1 epochs['face'].plot(events=events, event_colors={'buttonpress': 'red'})
/opt/mne/python/mne/epochs.py in plot(self, picks, scalings, n_epochs, n_channels, title, events, event_colors, order, show, block, decim, noise_cov, butterfly, show_scrollbars, epoch_colors)
1051 noise_cov=noise_cov, butterfly=butterfly,
1052 show_scrollbars=show_scrollbars,
-> 1053 epoch_colors=epoch_colors)
1054
1055 @copy_function_doc_to_method_doc(plot_epochs_psd)
/opt/mne/python/mne/viz/epochs.py in plot_epochs(epochs, picks, scalings, n_epochs, n_channels, title, events, event_colors, order, show, block, decim, noise_cov, butterfly, show_scrollbars, epoch_colors)
850 _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings,
851 title, picks, events=events, order=order,
--> 852 event_colors=event_colors, butterfly=butterfly)
853 _prepare_projectors(params)
854
/opt/mne/python/mne/viz/epochs.py in _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings, title, picks, events, event_colors, order, butterfly, info)
1110 if events is not None:
1111 event_set = set(events[:, 2])
-> 1112 event_colors = _handle_event_colors(event_set, event_colors, event_set)
1113 epoch_nr = False # epoch number off by default to avoid overlap
1114 for label in ax.xaxis.get_ticklabels():
/opt/mne/python/mne/viz/misc.py in _handle_event_colors(unique_events, color, unique_events_id)
1035 if this_event not in unique_events_id:
1036 raise ValueError('Event ID %s is in the color dict but is not '
-> 1037 'present in events or event_id.' % this_event)
1038
1039 for this_event in unique_events_id:
ValueError: Event ID buttonpress is in the color dict but is not present in events or event_id.
Describe the bug
epochs.plot(..., event_colors)raises value error whenevent_colorsuses keys that are inevent_iddictSteps to reproduce
Expected results
epochs.plot(..., event_colors)should check its keys against keys inepochs.event_idand plot the event lines (in this case event 32) in the requested color.Actual results
Here's the full traceback
Details
Additional information
mne.sys_info()Details
``` Platform: Linux-4.15.0-70-generic-x86_64-with-debian-buster-sid Python: 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00) [GCC 7.3.0] Executable: /opt/miniconda3/envs/mnedev/bin/python CPU: x86_64: 8 cores Memory: 7.6 GBmne: 0.20.dev0
numpy: 1.16.4 {blas=blas, lapack=blas}
scipy: 1.3.0
matplotlib: 3.1.0 {backend=Qt5Agg}
sklearn: 0.21.2
numba: Not found
nibabel: 2.4.1
cupy: Not found
pandas: 0.24.2
dipy: 0.16.0
mayavi: 4.7.1.dev0 {qt_api=pyqt5, PyQt5=5.9.2}
pyvista: 0.20.4
vtk: 8.1.2