.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorials/widgets/plot_3_waveforms_gallery.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_tutorials_widgets_plot_3_waveforms_gallery.py: Waveforms Widgets Gallery ========================= Here is a gallery of all the available widgets using a pair of RecordingExtractor-SortingExtractor objects. .. GENERATED FROM PYTHON SOURCE LINES 7-14 .. code-block:: Python import matplotlib.pyplot as plt import spikeinterface as si import spikeinterface.extractors as se import spikeinterface.widgets as sw .. GENERATED FROM PYTHON SOURCE LINES 15-16 First, let's generate a simulated dataset .. GENERATED FROM PYTHON SOURCE LINES 16-21 .. code-block:: Python recording, sorting = si.generate_ground_truth_recording() print(recording) print(sorting) .. rst-class:: sphx-glr-script-out .. code-block:: none GroundTruthRecording (InjectTemplatesRecording): 4 channels - 25.0kHz - 1 segments 250,000 samples - 10.00s - float32 dtype - 3.81 MiB GroundTruthSorting (NumpySorting): 10 units - 1 segments - 25.0kHz .. GENERATED FROM PYTHON SOURCE LINES 22-27 Extract spike waveforms ----------------------- For convenience, metrics are computed on the SortingAnalyzer object that gathers recording/sorting and the extracted waveforms in a single object .. GENERATED FROM PYTHON SOURCE LINES 27-37 .. code-block:: Python analyzer = si.create_sorting_analyzer(sorting=sorting, recording=recording, format="memory") # core extensions analyzer.compute(["random_spikes", "waveforms", "templates", "noise_levels"]) # more extensions analyzer.compute(["spike_amplitudes", "unit_locations", "spike_locations", "template_metrics"]) .. rst-class:: sphx-glr-script-out .. code-block:: none estimate_sparsity (no parallelization): 0%| | 0/10 [00:00 .. GENERATED FROM PYTHON SOURCE LINES 46-48 plot_unit_templates() ~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 48-54 .. code-block:: Python unit_ids = sorting.unit_ids sw.plot_unit_templates(analyzer, unit_ids=unit_ids, ncols=5, figsize=(16, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_002.png :alt: template 0, template 1, template 2, template 3, template 4, template 5, template 6, template 7, template 8, template 9 :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 55-57 plot_amplitudes() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 57-61 .. code-block:: Python sw.plot_amplitudes(analyzer, plot_histograms=True, figsize=(12, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_003.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 62-64 plot_unit_locations() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 64-68 .. code-block:: Python sw.plot_unit_locations(analyzer, figsize=(4, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_004.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 69-73 plot_unit_waveform_density_map() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is your best friend to check for overmerge .. GENERATED FROM PYTHON SOURCE LINES 73-78 .. code-block:: Python unit_ids = sorting.unit_ids[:4] sw.plot_unit_waveforms_density_map(analyzer, unit_ids=unit_ids, figsize=(14, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_005.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_005.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 79-81 plot_amplitudes_distribution() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 81-84 .. code-block:: Python sw.plot_all_amplitudes_distributions(analyzer, figsize=(10, 10)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_006.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_006.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 85-87 plot_units_depths() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 87-91 .. code-block:: Python sw.plot_unit_depths(analyzer, figsize=(10, 10)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_007.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_007.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 92-94 plot_unit_probe_map() ~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 94-100 .. code-block:: Python unit_ids = sorting.unit_ids[:4] sw.plot_unit_probe_map(analyzer, unit_ids=unit_ids, figsize=(20, 8)) plt.show() .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_008.png :alt: 0, 1, 2, 3 :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_008.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.018 seconds) .. _sphx_glr_download_tutorials_widgets_plot_3_waveforms_gallery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3_waveforms_gallery.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3_waveforms_gallery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_3_waveforms_gallery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_