.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_ERP_examples_plot_erp_example.py: ===================== ERP Analyses example ===================== This example shows how to use the ERP functions .. code-block:: python from sab_dataset import * from os.path import isdir, join import seaborn as sns sns.set() sns.set_context('paper') Load the data : sab dataset .. code-block:: python sab_dataset_dirpath = join('pySAB', 'sample_data') if isdir('pySAB') else join('..', '..', 'pySAB', 'sample_data') sab_dataset_filename = 'sab_dataset_rec_subject_id_040119_1153.p' rec_dataset = load_sab_dataset(join(sab_dataset_dirpath, sab_dataset_filename)) See information about this dataset .. code-block:: python print(rec_dataset) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none SAB dataset REC - subject_id 7 channels, 359 points [-0.10, 0.60s], sampling rate 512.0 Hz 356 trials : 183 hits, 173 correct rejects, 0 omissions, 0 false alarms Channel Info : 7 channels and 1 electrodes 7 EEG channels - 0 non-EEG channels 1 EEG electrodes - 0 non-EEG electrodes Plot the evoked response of channel 6 for 'hits' and 'correct reject' conditions (default) .. code-block:: python rec_dataset.plot_erp(6) .. image:: /auto_examples/ERP_examples/images/sphx_glr_plot_erp_example_001.png :class: sphx-glr-single-img Plot the ERPs of channels containing `'TB'4'` one for hits condition .. code-block:: python rec_dataset.plot_erp('EEG TP\'3-TP\'4', plot_hits=1, plot_cr=0, plot_fa=0, plot_omissions=0) .. image:: /auto_examples/ERP_examples/images/sphx_glr_plot_erp_example_002.png :class: sphx-glr-single-img Plot ERPs of the first electrode .. code-block:: python rec_dataset.plot_electrode_erps(0) .. image:: /auto_examples/ERP_examples/images/sphx_glr_plot_erp_example_003.png :class: sphx-glr-single-img **Total running time of the script:** ( 0 minutes 0.163 seconds) .. _sphx_glr_download_auto_examples_ERP_examples_plot_erp_example.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_erp_example.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_erp_example.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_