Chapter 1: raster plots

The raster plot describes the spike trains recorded from a neuron during the performance of some behavioral task (e.g., before and during an eye or arm movement). The raster plot is a bit more complicated to make than e.g., the velocity profile above, because we need to plot each row of the raster plot separately (where each row corresponds to a repetition of the neural recording, obtained by repeating the experiment multiple times). By repeating the experiment and making multiple recordings of spike trains from the same neuron, we can get a sense of the stable characteristics of the spike timing (relative to a behavior or to an experimental manipulation), even though the exact timing of neural firing will vary slightly from one repetition of the experiment to another.


We will plot simulated data inspired by the experiments of Porter, Metzger & Groh, 2007 (PNAS) in which single neurons from the inferior colliculus of macaque were recorded during an eye movement task. In this task, the monkey sat in complete darkness until a single LED (light emitting diode) was turned on at one of several possible locations. The monkey was required to fixate the LED as soon as it appeared (note that, because the eye position of the monkey was being monitored, the LED could be chosen to have a particular position relative to the monkey’s point of regard as it sat in the dark room, and therefore required an eye movement to fixate). After fixating the LED for a brief period (600-900 ms) a 200 ms-long tone was played. The tone indicated that juice reward would be given in 300-600 ms if the monkey continued to fixate the LED. If either the monkey failed to look at the LED within 3 s of it being turned on, or failed to maintain fixation as described above, no reward was given and the data from that trial was discarded. However, monkeys love juice, and so they soon learn to perform this task.


A typical repetition (‘trial’) of this experiment will last about 4s (1-3 seconds to look at the LED, 1.5 s to fixate, hear the sound, and continue fixation till reward is given), and during that time the data will consist of two types of number. The first is simply the eye position, which we will use to extract the time of the saccade and to verify fixation. The other is the spiking produced by the IC neuron being recorded. This latter data will simply be a list of times, starting at -.5 (one would start recording 500 ms prior to turning on the LED) and running until juice is delivered at a variable time later (usually about 3-4 seconds).


How do we take a set of spike times and try to understand what this neuron is ‘saying’, or what its output represents? With data of this type, our initial step is to create a set of raster plots. The first of these that we will create to examine the data described above will be raster plots of the spikes, when aligned to the onset of the LED (time zero, as defined in the description above).


To create the first plot, we open the raster function:

open raster

and manually change the exampletype variable to 1 (this is not its default value), then in the command window, type:

[Tcell]=raster; %this may take a few minutes to run

With no inputs, this function generates pre-programmed example data, Tcell.

Just looking at the data this way, we might get the impression that this IC neuron responds fairly reliably to the LED, but not much else (there are no obvious features beyond a prolonged increase in firing just after time zero). However, there is a variable time between the LED onset and the corresponding saccade in each trial, and another variable length of time between fixating the LED and the tone (and also between the tone and juice reward). Without aligning the data to each of these experimental events, we cannot tell if there is a reliable neural response corresponding to them. The data are already naturally aligned to the LED onset, so we simply take this plot and reproduce it (after truncating it a bit) in Fig. 1.5b.

[Tcell0 Tbar]=raster(Tcell(:,1),[-50 300],0,2);

figure(3); bar(Tbar(:,1),Tbar(:,2));

This command generates a raster plot from the Tcell data (first column of cells from the Tcell cell array) aligned at time 0 (third input), and plots rasters starting 200ms prior to time zero, and continuing for 300ms after time zero (second input); the last input to the raster function specifies the figure number to plot into. The second line uses the bar function to make the histogram positioned above this raster plot in Fig. 1.5. The second sub-plot should be re-aligned to correspond to saccade onset. Thus, we must look in the eye position data to find the time (within each trial) that the eye begins to move. We then re-label the spike times in that trial so that the start of the eye movement is at time 0 (for example, eye movement occurred at one second following LED onset, then the re-labeled times would put saccade onset at time -1s and the start of the trial at -1.5 s). After shifting the spike times for each trial individually based on saccade onset times (these times are contained in the third column of the Tcell cell array), we obtain the raster plot in Fig. 1.5c:

[Tcell0 Tbar]=raster(Tcell(:,1),[-200 300],Tcell(:,3),4);

figure(5); bar(Tbar(:,1),Tbar(:,2));


Finally, we perform the same time-shifting procedure on all spikes in the various trials once more, this time to put the onset of the auditory tone at time zero (i.e., for each trial, find the time of the auditory tone and subtract it from the LED-referenced spike times in that trial). The raster plot resulting from this second time-shift:

[Tcell0 Tbar]=raster(Tcell(:,1),[-200 300],Tcell(:,4),6);

figure(7); bar(Tbar(:,1),Tbar(:,2));

is shown in Fig. 1.5d. Note that here the times of the auditory tones are contained in the fourth column of the Tcell cell array.


We can see from the plots in c and d that there is consistent structure in the spiking of this IC neuron that was not initially obvious in the ‘raw’ (unshifted) data. Of course, this need not have been the case: The data may have looked like a raster plot obtained by again generating pre-programmed example data (but manually setting the exampletype variable to 2) using:

[Tcell]=raster;

where the overall data appear to have no obvious structure, and also several of the subplots constructed by re-zeroing the data in each trial also have no consistent response above baseline (we will analyze these data in the exercises). The fact that we do find a consistent response to all three experimental events suggests that the neuron is either responding to these events (e.g., detecting them), or is computing something relative to them. For example, the spiking at saccade onset would generally be taken as evidence that this neuron is involved in saccade planning and/or execution.