Visualize subject head movement

Show how subjects move as a function of time.

# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)

from os import path as op

import mne

print(__doc__)

data_path = op.join(mne.datasets.testing.data_path(verbose=True), 'SSS')

pos = mne.chpi.read_head_pos(op.join(data_path, 'test_move_anon_raw.pos'))

Out:

Successfully extracted to: [u'/home/ubuntu/mne_data/MNE-testing-data']

Visualize the subject head movements as traces:

mne.viz.plot_head_positions(pos, mode='traces')
../../_images/sphx_glr_plot_head_positions_001.png

Out:

viridis is unavailable on matplotlib < 1.4, using "YlGnBu_r"

Or we can visualize them as a continuous field (with the vectors pointing in the head-upward direction):

mne.viz.plot_head_positions(pos, mode='field')
../../_images/sphx_glr_plot_head_positions_002.png

Out:

viridis is unavailable on matplotlib < 1.4, using "YlGnBu_r"
pivot cannot be set in matplotlib 1.4.3 (need version 1.5+), locations are approximate

Gallery generated by Sphinx-Gallery