Module plottools.neurons
Draw sketches of neurons.
Axes member functions
neuron()
: draw a sketch of a neuron.
Install/uninstall neurons functions
You usually do not need to call these functions. Upon loading the neurons
module, install_neurons()
is called automatically.
install_neurons()
: install functions of the neurons module in matplotlib.uninstall_neurons()
: uninstall all code of the neurons module from matplotlib.
Functions
def neuron(ax, xy, r, label=None, xytarget=None, synapse='exc', adapt=0, xyinput=None, fc='white', ec='black', lw=2, **kwargs)
-
Draw a sketch of a neuron.
The coordinate system should have equal distances in both directions for the cell bodies being true circles. That is, you should call
ax.set_aspect('equal')
or
import plottools.aspect ax.set_ylim_equal()
Parameters
ax
:matplotlib axes
- Axes into which to draw the neuron.
xy
:tuple
offloats
- Coordinates of center of cell body in data coordinates.
r
:float
- Radius of cell body in data coordinates.
label
:string
orNone
- If not
None
, text to printed inside the cell body. xytarget
:tuple
offloats, sequence
oftuple
offloats
orNone
- If not
None
, list of x and y coordinates to which connections are drawn. The coordinates are the centers of the target neurons in data coordinates from which the radiusr
is subtracted. synapse
:'exc', 'inh'
or'arr'
orlis thereof
- For each
xytarget
the type of synapse to be drawn: excitatory synapse (a triangle), inhibitory synapse (a bar), or an arrow. adapt
:int
- If not zero draw a self-inhibitory circular connection, indicating an adaptation current. - 1: draw self-inhibition to the side of the top-most connection to a target neuron. - 2: draw self-inhibition opposite of outgoing connections to target neurons. - 3: draw self-inhibition on top.
xyinput
:tuple
offloats
orNone
- If not
None
, draw an input arrow originating from the given coordinates (in data coordinates). fc
:matplotlib color specification
- Fill color for the cell body.
ec
:matplotlib color specification
- Edge color for the cell body and line color for all the connections, synapses and arrows.
lw
:float
- Line width for the cell body and line color for all the connections, synapses and arrows.
**kwargs
:key-word arguments
- Arguments passed on to
ax.text()
for drawing thelabel
.
def install_neurons()
-
Install neurons functions on matplotlib axes.
This function is also called automatically upon importing the module.
See Also
def uninstall_neurons()
-
Uninstall neurons functions from matplotlib axes.
Call this code to disable anything that was installed by
install_neurons()
.See Also
def demo()
-
Run a demonstration of the neurons module.