MNE-python plotting evoked responses

Greetings
I am using the following loop to plot the evoked response iterating over
several different conditions:
# Create the figure (Letter format)
for j, cond in enumerate(['Known', 'Known-ctrl', 'Unknown', 'Unkown-ctrl']):
    figure(num=j, figsize=(8.5,11), dpi=100)
    ax = subplot2grid((4, 2), (j, 0), rowspan=1, colspan=2)
    ax.set_title(r"$MEG evoked field, %s trials$" % cond, fontsize=16)
    evokeds[j].plot(picks=mag_picks, axes=ax)
    # Save to PDF
    #savefig("%s.pdf" % TITLE)

I get the figure(s) I want but I cannot figure out how to set the title.
The above ax.set_title statement seems to do nothing, nor does
evokeds[j].plot(picks=mag_picks, axes=ax, titles=event_ids);
where event_ids = {'Known': 1, 'Known-ctrl': 2, 'Unknown': 3,
'Unkown-ctrl': 4}. In both case the axes title defaults to channel type
e.g., Magnetometers (102 channels). If I follow the example
here<http://martinos.org/mne/auto_examples/plot_from_raw_to_multiple_epochs_to_evoked.html>
then
the above code will generate additional empty axes with the names I want
for each iteration; i.e., inserting the statement: `title ("MEG evoked
field, %s trials" % cond)` into the loop. Could someone please explain this
behavior? Thanks in advance. Kambiz

Hey Kambiz,

mne-python will overwrite your axis title with its own. Does it work if you
move the line ax.set_title after the evokeds.plot() line?

The "titles" keywoard argument not working might be a bug, I'd have to look
(Alex, Denis?).

Eric

Hi Eric,

With the ax.set_title line in either position I get the same behavior i.e.,
X axes with butterfly plot & default axis title generated by evoked.plot
and X blank axes with the desired title.

Kambiz

hi Kambiz,

have a look at this example:

http://martinos.org/mne/auto_examples/plot_from_raw_to_multiple_epochs_to_evoked.html

for an example of subplots with custom titles.

hope this helps

Alex

Hi Kambiz,

hi Kambiz,

have a look at this example:

http://martinos.org/mne/auto_examples/plot_from_raw_to_multiple_epochs_to_evoked.html

an alternative way to do it is illustrated in this example:

http://martinos.org/mne/auto_examples/plot_evoked_delayed_ssp.html#example-plot-evoked-delayed-ssp-py

Best,
Denis

for an example of subplots with custom titles.

hope this helps

Alex

> Hi Eric,
>
> With the ax.set_title line in either position I get the same behavior
i.e.,
> X axes with butterfly plot & default axis title generated by evoked.plot
and
> X blank axes with the desired title.
>
> Kambiz
>
>
>>
>> Hey Kambiz,
>>
>> mne-python will overwrite your axis title with its own. Does it work if
>> you move the line ax.set_title after the evokeds.plot() line?
>>
>> The "titles" keywoard argument not working might be a bug, I'd have to
>> look (Alex, Denis?).
>>
>> Eric
>>
>>
>>
>>>
>>> Greetings
>>> I am using the following loop to plot the evoked response iterating
over
>>> several different conditions:
>>> # Create the figure (Letter format)
>>> for j, cond in enumerate(['Known', 'Known-ctrl', 'Unknown',
>>> 'Unkown-ctrl']):
>>> figure(num=j, figsize=(8.5,11), dpi=100)
>>> ax = subplot2grid((4, 2), (j, 0), rowspan=1, colspan=2)
>>> ax.set_title(r"MEG evoked field, %s trials" % cond, fontsize=16)
>>> evokeds[j].plot(picks=mag_picks, axes=ax)
>>> # Save to PDF
>>> #savefig("%s.pdf" % TITLE)
>>>
>>> I get the figure(s) I want but I cannot figure out how to set the
title.
>>> The above ax.set_title statement seems to do nothing, nor does
>>> evokeds[j].plot(picks=mag_picks, axes=ax, titles=event_ids); where
event_ids
>>> = {'Known': 1, 'Known-ctrl': 2, 'Unknown': 3, 'Unkown-ctrl': 4}. In
both
>>> case the axes title defaults to channel type e.g., Magnetometers (102
>>> channels). If I follow the example here then the above code will
generate
>>> additional empty axes with the names I want for each iteration; i.e.,
>>> inserting the statement: `title ("MEG evoked field, %s trials" %
cond)` into
>>> the loop. Could someone please explain this behavior? Thanks in
advance.
>>> Kambiz
>>>
>>> --
>>> ------------------------------------------------------------
>>> Kambiz Tavabi PhD
>>> Institute for Learning & Brain Sciences
>>> 1715 Columbia Road N
>>> Portage Bay Building
>>> Box 357988
>>> University of Washington
>>> Seattle, WA 98195-7988
>>> Tel: 206-685-6173
>>> ------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> Mne_analysis Info Page
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom
it
>>> is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to
you in
>>> error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>>
>
>
>
> --
> ------------------------------------------------------------
> Kambiz Tavabi PhD
> Institute for Learning & Brain Sciences
> 1715 Columbia Road N
> Portage Bay Building
> Box 357988
> University of Washington
> Seattle, WA 98195-7988
> Tel: 206-685-6173
> ------------------------------------------------------------
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> The information in this e-mail is intended only for the person to whom
it is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130801/c883206c/attachment.html

Hi Denis,

The plotting in the delayed-ssp demo is exactly what I was looking for.
Thank you. However, it looks like some ipython notebook finickiness
prevents me from pulling it off in a notebook.

best,
Kam