On 16 May 2014 04:17, mainakjas <notifications@github.com> wrote:

> In mne/viz.py:
>
> > +        # sorted by value
> > +        labels, unique_events = zip(*sorted(event_id.items(),
> > +                                    key=lambda x: x[1]))
> > +
> > +        # check that event_id values match existing events
> > +        find_ev = set(unique_events).intersection(set(np.unique(events[:, 2])))
> > +        if not find_ev:
> > +            warnings.warn('These event_ids do not exist.'
> > +                          ' Existing events will be used.')
> > +            unique_events = np.unique(events[:, 2])
> > +            event_id = None
> > +
> > +        else:
> > +            if len(unique_events) > len(np.unique(events[:, 2])):
> > +                warnings.warn('More event_id than existing events.'
> > +                              ' Extra events not plotted.')
>
> If I do
>
> event_id = dict(aud_l=1, aud_r=2, some_event=16)
>
> and some_event does not exist, I still get a legend for some_event
>
thanks @mainakjas. Fixed.

>  —
> Reply to this email directly or view it on GitHub<https://github.com/mne-tools/mne-python/pull/1266/files#r12729065>
> .
>