Warning

This version of the documentation is NOT an official release. You are looking at ‘latest’, which is in active and ongoing development. You can change versions on the bottom left of the screen.

Create three populations of iaf_psc_alpha neurons on a 4x3 grid, each with different center

BCCN Tutorial @ CNS*09 Hans Ekkehard Plesser, UMB

import nest
import matplotlib.pyplot as plt
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., 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]))

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery