From 04ac84998924fb07a4a52f22443d54da3a8a311e Mon Sep 17 00:00:00 2001 From: Nick Tolley Date: Tue, 20 Apr 2021 15:05:55 -0400 Subject: [PATCH] Add basic connectivity matrix plotting --- examples/plot_connectivity.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/plot_connectivity.py b/examples/plot_connectivity.py index e78748cf1..ca3af620a 100644 --- a/examples/plot_connectivity.py +++ b/examples/plot_connectivity.py @@ -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: @@ -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 @@ -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