.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/ex_03_generate_probe_group.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_ex_03_generate_probe_group.py: Generate a ProbeGroup --------------------- This example shows how to assemble several Probe objects into a ProbeGroup object. .. GENERATED FROM PYTHON SOURCE LINES 10-11 Import .. GENERATED FROM PYTHON SOURCE LINES 11-19 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from probeinterface import Probe, ProbeGroup from probeinterface.plotting import plot_probegroup from probeinterface import generate_dummy_probe .. GENERATED FROM PYTHON SOURCE LINES 20-22 Generate 2 dummy `Probe` objects with the utils function: .. GENERATED FROM PYTHON SOURCE LINES 22-27 .. code-block:: Python probe0 = generate_dummy_probe(elec_shapes='square') probe1 = generate_dummy_probe(elec_shapes='circle') probe1.move([250, -90]) .. GENERATED FROM PYTHON SOURCE LINES 28-30 Let's create a `ProbeGroup` and add the `Probe` objects into it: .. GENERATED FROM PYTHON SOURCE LINES 30-39 .. code-block:: Python probegroup = ProbeGroup() probegroup.add_probe(probe0) probegroup.add_probe(probe1) print('probe0.get_contact_count()', probe0.get_contact_count()) print('probe1.get_contact_count()', probe1.get_contact_count()) print('probegroup.get_contact_count()', probegroup.get_contact_count()) .. rst-class:: sphx-glr-script-out .. code-block:: none probe0.get_contact_count() 32 probe1.get_contact_count() 32 probegroup.get_contact_count() 64 .. GENERATED FROM PYTHON SOURCE LINES 40-41 We can now plot all probes in the same axis: .. GENERATED FROM PYTHON SOURCE LINES 41-44 .. code-block:: Python plot_probegroup(probegroup, same_axes=True) .. image-sg:: /examples/images/sphx_glr_ex_03_generate_probe_group_001.png :alt: ex 03 generate probe group :srcset: /examples/images/sphx_glr_ex_03_generate_probe_group_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 45-46 or in separate axes: .. GENERATED FROM PYTHON SOURCE LINES 46-50 .. code-block:: Python plot_probegroup(probegroup, same_axes=False, with_contact_id=True) plt.show() .. image-sg:: /examples/images/sphx_glr_ex_03_generate_probe_group_002.png :alt: ex 03 generate probe group :srcset: /examples/images/sphx_glr_ex_03_generate_probe_group_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.183 seconds) .. _sphx_glr_download_examples_ex_03_generate_probe_group.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ex_03_generate_probe_group.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ex_03_generate_probe_group.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ex_03_generate_probe_group.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_