{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Plotting EEG sensors on the scalp\n\nIn this example, digitized EEG sensor locations are shown on the scalp.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Eric Larson \n#\n# License: BSD-3-Clause\n# Copyright the MNE-Python contributors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import mne\nfrom mne.viz import plot_alignment, set_3d_view\n\nprint(__doc__)\n\ndata_path = mne.datasets.sample.data_path()\nsubjects_dir = data_path / \"subjects\"\nmeg_path = data_path / \"MEG\" / \"sample\"\ntrans = mne.read_trans(meg_path / \"sample_audvis_raw-trans.fif\")\nraw = mne.io.read_raw_fif(meg_path / \"sample_audvis_raw.fif\")\n\n# Plot electrode locations on scalp\nfig = plot_alignment(\n raw.info,\n trans,\n subject=\"sample\",\n dig=False,\n eeg=[\"original\", \"projected\"],\n meg=[],\n coord_frame=\"head\",\n subjects_dir=subjects_dir,\n)\n\n# Set viewing angle\nset_3d_view(figure=fig, azimuth=135, elevation=80)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 0 }