Module plottools.neurons

Draw sketches of neurons.

Axes member functions

Install/uninstall neurons functions

You usually do not need to call these functions. Upon loading the neurons module, install_neurons() is called automatically.

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 of floats
Coordinates of center of cell body in data coordinates.
r : float
Radius of cell body in data coordinates.
label : string or None
If not None, text to printed inside the cell body.
xytarget : tuple of floats, sequence of tuple of floats or None
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 radius r is subtracted.
synapse : 'exc', 'inh' or 'arr' or lis 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 of floats or None
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 the label.
def install_neurons()

Install neurons functions on matplotlib axes.

This function is also called automatically upon importing the module.

See Also

uninstall_neurons()

def uninstall_neurons()

Uninstall neurons functions from matplotlib axes.

Call this code to disable anything that was installed by install_neurons().

See Also

install_neurons()

def demo()

Run a demonstration of the neurons module.