brian2tools.plotting.synapses module¶
Module to plot synaptic connections.
-
brian2tools.plotting.synapses.
plot_synapses
(sources, targets, values=None, var_unit=None, var_name=None, plot_type='scatter', axes=None, **kwds)[source]¶ Parameters: - sources (
ndarray
of int) – The source indices of the connections (as returned bySynapses.i
). - targets (
ndarray
of int) – The target indices of the connections (as returned bySynapses.j
). - values (
Quantity
,ndarray
) – The values to plot, a 1D array of the same size assources
andtargets
. - var_unit (
Unit
, optional) – The unit to use to plot thevalues
(e.g.mV
for a membrane potential). If none is given (the default), an attempt is made to find a good scale automatically based on thevalues
. - var_name (str, optional) – The name of the variable that is plotted. Used for the axis label.
- plot_type ({
'scatter'
,'image'
,'hexbin'
}, optional) – What type of plot to use. Can be'scatter'
(the default) to draw a scatter plot,'image'
to display the connections as a matrix or'hexbin'
to display a 2D histogram using matplotlib’shexbin
function. For a large number of synapses,'scatter'
will be very slow. Similarly, an'image'
plot will use a lot of memory for connections between two large groups. For a small number of neurons and synapses,'hexbin'
will be hard to interpret. - axes (
Axes
, optional) – TheAxes
instance used for plotting. Defaults toNone
which means that a newAxes
will be created for the plot. - kwds (dict, optional) – Any additional keywords command will be handed over to the respective
matplotlib command (
scatter
if theplot_type
is'scatter'
,imshow
for'image'
, andhexbin
for'hexbin'
). This can be used to set plot properties such as themarker
.
Returns: axes – The
Axes
instance that was used for plotting. This object allows to modify the plot further, e.g. by setting the plotted range, the axis labels, the plot title, etc.Return type: - sources (