Related Documentation:
Contributed By:
Dave Beeman (dbeeman@dogstar.colorado.edu)
Based on fplot.py for plotting the membrane potential from the G-3 implementation
of tutorial4 written by Karthikeyan Subramanian (kartikznov@gmail.com)
This is a preliminary version of a collection of stand-alone Python-based graphical utilities for plotting the output of GENESIS simulations. The simulations use the asc_file object to write simulation variables to a file, with one line per step of the output clock. These scripts may also be useful as prototypes of graphical objects that could be more directly incorporated into the GENESIS GUI G-Tube.
These scripts make use of the powerful scientific graphics capability of Matplotlib, which easily generates a wide variety of plots, accompanied by a Navigation Toolbar that allows for panning and zooming of plots, and saving to publication quality PNG format images.
To run these scripts, you need Python Ver. 2.5 or later, and the Matplotlib library for Python. The installation instructions explain other requirememts, such as NumPy (numerical libraries for Python) that are usually installed along with Python on most Linux systems.
The main script of this package, G3Plot.py, also requires wxPython, the Python implemention of the wxWidgets widget set now used by GENESIS.
The use of these Python libraries is described in the Frontiers in Neuroinformatics special issue on Python in Neuroscience.
Brief description of the scripts and their usage:
fplot.py Vm.out
|
plotVm.py Vm.out pyr4*.out
|
It has labels and scales specific for membrane potential plots, and is handy for quickly comparing the results of current injection simulations. The (x,y) coordinates of a point on the graph can be displayed in the Navigation Toolbar by positioning the cursor over it.
Figure 1 shows a plot generated with
rasterplot.py spike_times.txt
|
It addition to the usual Menu bar with File and Help menus, it has a Control Panel of colored buttons and toggles for clearing the plot, plotting, setting overlay ON or OFF, and toggling the Legend display. The Legend identifies each colored line on the graph with the filename in the same color.
The HTML Usage help describes the use of the Matplotlib Toolbar that is used in all these programs, as well as Menu choices and Control Panel buttons. The Program Info scrolling message dialog gives information obtained from program documentation strings about the objects and functions, and the wxPython and matplotlib classes that are used here.
Figure 2 shows a screen dump of the GUI with Usage and About help displayed with the plot.
The screen dump was produced with the following command and arguments:
G3Plot.py pyr4*.out Vm.out
|
Figure 3 (called freqplot-HD2500-11p.eps) shows the contour plot generated from
rowrateplot.py spike_freq_HD2500-11p.txt
|
The data file was produced from asc_file output of a G-2 layer 4 auditory cortex simulation. The parameters used for the connection weights in this run provided strong response to the random background input, and to a 220 Hz tone pulse with thalamic input to row 25 and nearby rows, lasting from 0.25–0.75 s. rowrateplot.py will be useful for tuning parameters to balance excitation and inhibition.
Under Fedora 12 Linux, the scripts plotVm.py and rasterplot.py produce the warning message:
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip self.tooltips = gtk.Tooltips()
|
G3Plot.py does not produce this warning, but does not show the (x,y) coordinates of the cursor in the Navigation Toolbar. This is a very handy feature of plotVm.py, when measuring action potential times and amplitudes.
Note: G3Plot.py uses the Matplotlib backend API for embedding in wxPython, matplotlib.backends.backend_wxagg NavigationToolbar2WxAgg. The other scripts, which do not use wxPython, use matplotlib.pyplot.figure, which has the Toolbar built in. Possibly, there is a setting to enable this feature hidden somewhere in NavigationToolbar2WxAgg.