Visualization of simulation data often requires custom code, but we provide two ways to get a general idea of the simulated spike data.


Rasterplot-pdf allows you to create a pdf file with rasterplots of a batch of simulations. You can run it using the cxvisualize command (more on the command). For example, to create raster plots of all simulations run on 13 December 2019 at 13:37 in a particular directory, you can write

cxvisualize --rasterplot-pdf ~/CxWorkspace/my_simulation/ 20191213_1337

This creates a pdf file with the specified timestamp in the same directory. Note that this script is very basic and is intended only for screening that there is not a simple bug in the simulation configuration.


ViSimpl allows you to visualize the time course and geometry of spiking in a single simulation. First, download the ViSimpl binary (the .AppImage binary is for Linux and the .dmg binary is for macOS). Then put the ViSimpl binary in a directory that is located in your system path. Also, remove version numbering from the binary and make it executable:

mv visimpl-0.1.4-x86_64.AppImage visimpl.AppImage
chmod +x visimpl.AppImage

After this you can visualize CxSystem2 spike data in ViSimpl using the cxvisualize command:

cxvisualize ~/CxWorkspace/my_simulation/my_simulation_results.gz

This opens up the ViSimpl main screen. You should be able to rotate the circuit and “play” the simulation without further configuration. To learn how you can customize the visualization, please see the ViSimpl website.

Custom visualizations

Simulation data are stored in dictionaries in the results file. For example, to access spike data in a gzipped file, you can write:

import zlib
import pickle

fi = open('my_simulation_results.gz', 'rb')
data_pickle = zlib.decompress(
data = pickle.loads(data_pickle)

spike_data = data['spikes_all']
neuron_positions = data['positions_all]

After this, spikes are available in the spike_data dictionary indexed by neuron group names. Then, for each neuron group, you have a dictionary with arrays i (neuron index) and t (spike time).

Similarly, neuron positions are available in the neuron_positions dictionary containing two subdictionaries: w_coord (cortical position) and z_coord (retinal position). If you are not modelling the visual system, you can ignore the z_coord subdictionary.