On 19 May 2014 04:13, Alexandre Gramfort <notifications@github.com> wrote:

> In mne/viz.py:
>
> >      import matplotlib.pyplot as plt
> >      fig = plt.figure()
> > -    min_event = np.min(events[:, 2])
> > -    max_event = np.max(events[:, 2])
> > -    plt.plot((events[:, 0] - first_samp) / sfreq, events[:, 2], '.')
> > +    min_event = np.min(unique_events_id)
> > +    max_event = np.max(unique_events_id)
> > +
> > +    for idx, ev in enumerate(unique_events_id):
> > +        ev_mask = events[:, 2] == ev
> > +        kwargs = {}
> > +        if event_id is not None:
> > +            kwargs['label'] = event_id_rev[ev]
> > +        if ev in color:
> > +            kwargs['color'] = color[ev]
>
>  I don't think it's necessary. We always have colors for each event.
> Either they are set or we cycle. In both cases we can iterate. Ok?
> here we let matplotlib guess a color if none is provided. I thinking about
> removing the cycle on COLORS and just let it guess the colors.
>

If the user passes color = {1: 'red', 5: 'black', 32: 'purple'} and no
event_id, the 6 events are plotted but red appears for 1 and also 4
(default). Is matplotlib supposed to avoid picking a redundant colour?


> —
> Reply to this email directly or view it on GitHub<https://github.com/mne-tools/mne-python/pull/1287/files#r12783287>
> .
>