TFR plot

Hello all,

Do you know if it is possible to crop a tfr plot like in the attached
picture to get rid of unwanted frequency bands. Thanks in advance.

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171109/5134849d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tfr.JPG
Type: image/jpeg
Size: 13251 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171109/5134849d/attachment.jpe

hi,

you can use pcolor eg
https://matplotlib.org/examples/pylab_examples/pcolor_demo.html
but a simpler option would be to put np.nan in values you don't want
to plot and matplotlib
with mask it.

HTH
Alex

thanks !

2017-11-09 21:07 GMT+01:00 Alexandre Gramfort <alexandre.gramfort at inria.fr>:

hi,

you can use pcolor eg
https://matplotlib.org/examples/pylab_examples/pcolor_demo.html
but a simpler option would be to put np.nan in values you don't want
to plot and matplotlib
with mask it.

HTH
Alex

> Hello all,
>
> Do you know if it is possible to crop a tfr plot like in the attached
> picture to get rid of unwanted frequency bands. Thanks in advance.
>
> Jeremy
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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
> http://www.partners.org/complianceline . 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
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

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

Yeah I usually do this by creating *two* separate pcolor plots, and then
arranging the axes so that it *looks* like they're part of the same axis w/
a break in the middle

If the aim is to clearly see low frequencies while ranging up to high
frequencies, it is probably better to use a logarithmic frequency scale.

You can do this by simply changing the axis: e.g.

plt.gca().set_yscale('log')

Better, you can do this when you compute the time frequency decomposition.
For example in this tutorial (
https://martinos.org/mne/stable/auto_examples/time_frequency/plot_time_frequency_simulated.html),
change

freqs = np.arange
<https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.arange.html#numpy.arange>(5.,
100., 3.)

by

freqs = np.l <https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.arange.html#numpy.arange>ogspace(np.log10(5.),
np.log10(100.), 32)

HTH
JR

thank you !

2017-11-10 16:04 GMT+01:00 JR KING <jeanremi.king at gmail.com>:

If the aim is to clearly see low frequencies while ranging up to high
frequencies, it is probably better to use a logarithmic frequency scale.

You can do this by simply changing the axis: e.g.

plt.gca().set_yscale('log')

Better, you can do this when you compute the time frequency decomposition.
For example in this tutorial (https://martinos.org/mne/
stable/auto_examples/time_frequency/plot_time_frequency_simulated.html),
change

freqs = np.arange <https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.arange.html#numpy.arange&gt;\(5., 100., 3.)

by

freqs = np.l <https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.arange.html#numpy.arange&gt;ogspace\(np\.log10\(5\.\), np.log10(100.), 32)

HTH
JR

Yeah I usually do this by creating *two* separate pcolor plots, and then
arranging the axes so that it *looks* like they're part of the same axis w/
a break in the middle
--

thanks !

2017-11-09 21:07 GMT+01:00 Alexandre Gramfort <
alexandre.gramfort at inria.fr>:

hi,

you can use pcolor eg
https://matplotlib.org/examples/pylab_examples/pcolor_demo.html
but a simpler option would be to put np.nan in values you don't want
to plot and matplotlib
with mask it.

HTH
Alex

> Hello all,
>
> Do you know if it is possible to crop a tfr plot like in the attached
> picture to get rid of unwanted frequency bands. Thanks in advance.
>
> Jeremy
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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
> http://www.partners.org/complianceline . 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
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

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
http://www.partners.org/complianceline . 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
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

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
http://www.partners.org/complianceline . 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
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

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
http://www.partners.org/complianceline . 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.

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