Skip to content

Commit

Permalink
Add basic connectivity matrix plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
ntolley authored and jasmainak committed May 19, 2021
1 parent 79e92f1 commit 04ac849
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/plot_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
# We can modify the connectivity list to test the effect of different
# connectivity patterns. For example, we can remove 90% all layer 2 inhibitory
# connections.
# This can be achieved with :meth:`hnn_core._Connectivity.update_probability`,
# a function that is available for each element of ``net.connectivity``.
# This can be achieved with ``net.connectivity[idx].drop``, a function that is
# available for each element of ``net.connectivity``. We can also visualize
# any connection using ``net.connectivity.plot``.
# Note that in the default network, the src_gids of each connection are
# all the same cell type allowing for easy modifications.
for conn in net.connectivity:
Expand All @@ -63,6 +64,7 @@
net_remove = net.copy()
dpl_remove = simulate_dipole(net_remove, n_trials=1)
net_remove.cell_response.plot_spikes_raster()
net.connectivity[10].plot()

###############################################################################
# That's a lot of spiking! Since basket cells are inhibitory, removing these
Expand All @@ -85,6 +87,7 @@
net_add = net.copy()
dpl_add = simulate_dipole(net_add, n_trials=1)
net_add.cell_response.plot_spikes_raster()
net.connectivity[-1].plot()

###############################################################################
# Adding a single inhibitory connection didn't completely restored the normal
Expand Down

0 comments on commit 04ac849

Please sign in to comment.