Back to the main page.

Bug 2074 - ft_spike_plot_raster: trial selection results in sparse raster plot

Reported 2013-03-22 12:41:00 +0100
Modified 2019-08-10 12:29:17 +0200
Product: FieldTrip
Component: spike
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P3 enhancement
Assigned to: Martin Vinck
Depends on:
See also:

Joscha Schmiedt - 2013-03-22 12:41:24 +0100

Created attachment 443 Example of sparse raster plot with 85/1289 trials selected Since the a trial selection with cfg.trials doesn't alter the actual trial numbers the resulting raster plot can look very sparse, depending on the number of selected trials. Since this is not the actual neuronal behavior there should be an option to remove the 'empty' trials from the plot.

Martin Vinck - 2013-03-23 00:57:21 +0100

I'm not so sure about this one - the original idea was that you can use this feature to plot multiple conditions in one raster. If you want to avoid this, you can simply select the trials beforehand and then enter this struct into the raster plot.

Joscha Schmiedt - 2013-03-23 10:27:00 +0100

(In reply to comment #1) That doesn't solve the problem because ft_spike_select doesn't alter the trial numbers but just removes the ones not in a selected trial ... spike.trial{iUnit} = spike.trial{iUnit}(spikesInTrial); ... If this is intended behavior I'm fine with that, but it should be clearly documented. As an easy workaround, I can recommend the third output argument of unique, e.g. like [~, ~, renumberedTrials] = unique(spike.trial{iUnit})

Ian Andolina - 2014-07-22 12:26:58 +0200

Note: I added an optional cfg setting to fix this which is merged in the current FT...

Robert Oostenveld - 2019-08-10 12:29:17 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on