.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/spatial/grid_iaf_oc.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_auto_examples_spatial_grid_iaf_oc.py: Spatial networks: 4x3 grid for three populations ------------------------------------------------ .. only:: html ---- Run this example as a Jupyter notebook: .. card:: :width: 25% :margin: 2 :text-align: center :link: https://lab.ebrains.eu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fnest%2Fnest-simulator-examples&urlpath=lab%2Ftree%2Fnest-simulator-examples%2Fnotebooks%2Fnotebooks%2Fspatial%2Fgrid_iaf_oc.ipynb&branch=main :link-alt: JupyterHub service .. image:: https://nest-simulator.org/TryItOnEBRAINS.png .. grid:: 1 1 1 1 :padding: 0 0 2 0 .. grid-item:: :class: sd-text-muted :margin: 0 0 3 0 :padding: 0 0 3 0 :columns: 4 See :ref:`our guide ` for more information and troubleshooting. ---- Create three populations of iaf_psc_alpha neurons on a 4x3 grid, each with different center. BCCN Tutorial @ CNS*09 Hans Ekkehard Plesser, UMB .. GENERATED FROM PYTHON SOURCE LINES 31-55 .. code-block:: Python import matplotlib.pyplot as plt import nest import numpy as np for ctr in [(0.0, 0.0), (-2.0, 2.0), (0.5, 1.0)]: plt.figure() nest.ResetKernel() l1 = nest.Create("iaf_psc_alpha", positions=nest.spatial.grid(shape=[4, 3], extent=[2.0, 1.5], center=ctr)) nest.PlotLayer(l1, nodesize=50, fig=plt.gcf()) # beautify plt.axis([-3, 3, -3, 3]) plt.axes().set_aspect("equal", "box") plt.axes().set_xticks(np.arange(-3.0, 3.1, 1.0)) plt.axes().set_yticks(np.arange(-3.0, 3.1, 1.0)) plt.grid(True) plt.xlabel(f"4 Columns, Extent: 1.5, Center: {ctr[0]:.1f}") plt.ylabel(f"2 Rows, Extent: 1.0, Center: {ctr[1]:.1f}") plt.show() # plt.savefig('grid_iaf_oc_{}_{}.png'.format(ctr[0], ctr[1])) .. _sphx_glr_download_auto_examples_spatial_grid_iaf_oc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: grid_iaf_oc.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: grid_iaf_oc.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_