Skip to content

Evoked comparison figure changes default pyplot style params  #4091

Closed

Description

@ktavabi

Buggy behavior in mne.viz.plot_compare_evokeds that botches some/all default matplotlib rc params. Both with my own data as well as [tutorial] gist(http://martinos.org/mne/stable/auto_tutorials/plot_visualize_evoked.html#sphx-glr-auto-tutorials-plot-visualize-evoked-py) I get arbitrarily colored axes background that I can't control.

import os.path as op
import numpy as np
import matplotlib.pyplot as plt

import mne

data_path = mne.datasets.sample.data_path()
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True)
conditions = ["Left Auditory", "Right Auditory", "Left visual", "Right visual"]
evoked_dict = dict()
for condition in conditions:
    evoked_dict[condition.replace(" ", "/")] = mne.read_evokeds(
        fname, baseline=(None, 0), proj=True, condition=condition)
print(evoked_dict)

colors = dict(Left="Crimson", Right="CornFlowerBlue")
linestyles = dict(Auditory='-', visual='--')
pick = evoked_dict["Left/Auditory"].ch_names.index('MEG 1811')

mne.viz.plot_compare_evokeds(evoked_dict, picks=pick,
                             colors=colors, linestyles=linestyles) 

Returns

screen shot 2017-03-24 at 2 02 25 pm

cc @jona-sassenhagen

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions