.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plot_eeg_graph.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_plot_eeg_graph.py: Plot EEG Graph. =================== Example to plot EEG graph using EEGrasp package. The EEG graph is constructed using the electrode positions from the Biosemi 64 channel montage. The graph is plotted in 3D and topoplot formats. .. GENERATED FROM PYTHON SOURCE LINES 8-9 .. code-block:: Python import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 10-15 .. code-block:: Python import mne import numpy as np from eegrasp import EEGrasp .. GENERATED FROM PYTHON SOURCE LINES 16-23 .. code-block:: Python montage = mne.channels.make_standard_montage('biosemi64') ch_names = montage.ch_names EEG_pos = montage.get_positions()['ch_pos'] # Restructure into array EEG_pos = np.array([pos for _, pos in EEG_pos.items()]) .. GENERATED FROM PYTHON SOURCE LINES 24-29 .. code-block:: Python gsp = EEGrasp(coordinates=EEG_pos, labels=ch_names) Z = gsp.compute_distance(EEG_pos) G = gsp.compute_graph(sigma=0.1, epsilon=0.2) .. GENERATED FROM PYTHON SOURCE LINES 30-35 .. code-block:: Python fig, ax = gsp.plot() fig, ax = gsp.plot(kind='3d') plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/images/sphx_glr_plot_eeg_graph_001.png :alt: Graph(n_vertices=64, n_edges=107) :srcset: /examples/images/sphx_glr_plot_eeg_graph_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/images/sphx_glr_plot_eeg_graph_002.png :alt: Graph(n_vertices=64, n_edges=107) :srcset: /examples/images/sphx_glr_plot_eeg_graph_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/eegrasp/envs/latest/lib/python3.11/site-packages/pygsp2/plotting.py:589: UserWarning: No data for colormapping provided via 'c'. Parameters 'vmin', 'vmax' will be ignored sc = ax.scatter(*G.coords.T, /home/docs/checkouts/readthedocs.org/user_builds/eegrasp/envs/latest/lib/python3.11/site-packages/pygsp2/plotting.py:589: UserWarning: No data for colormapping provided via 'c'. Parameters 'vmin', 'vmax' will be ignored sc = ax.scatter(*G.coords.T, .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.652 seconds) **Estimated memory usage:** 192 MB .. _sphx_glr_download_examples_plot_eeg_graph.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_eeg_graph.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_eeg_graph.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_eeg_graph.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_