Skip to content

Commit 521bb5e

Browse files
committed
Color-coded amplitude scatter plots. But wait there's more. Grids.
1 parent f2ee0f9 commit 521bb5e

7 files changed

Lines changed: 25 additions & 6 deletions

File tree

@SplitMerge/SplitMerge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ function saveAsSpikes(app,~)
499499
% set app.Data.modified to 1 to force re-plots when changing
500500
% tabs, or after a merge, etc. One flag for each tab.
501501
app.Data.modified = [0 0 0 0 0 0];
502-
app.Data.modifylist = [];
502+
app.Data.modifyList = [];
503503

504504
if ~app.Settings.Debugging
505505
warning('off','MATLAB:callback:error');

@SplitMerge/UnitSelection.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ function UnitSelection(app,event)
2323
end
2424
xlim(app.MergedWaves,[t(1) t(end)]);
2525
ylim(app.MergedWaves,[mn-10 mx+10])
26+
app.MergedWaves.XGrid = 'on';
27+
app.MergedWaves.YGrid = 'on';
2628

2729
if ~isempty(app.Data.Selected)
2830
plotDetectionCriterion(app,app.MergedMissing);

@SplitMerge/mergeNow.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ function mergeNow(app,~)
66

77
app.MergeButton.Enable = 'off';
88
app.GarbageButton.Enable = 'off';
9-
9+
app.Data.modifyList(end+1) = app.Data.Selected(1);
10+
1011
for s = 2:length(app.Data.Selected)
1112
if app.Settings.Debugging
1213
disp([9 'Merging ' num2str(app.Data.Selected(s)) ' with ' num2str(app.Data.Selected(1))])
1314
end
1415
% dependent on merge_clusters from UMS:
1516
app.Data.spikes = merge_clusters(app.Data.spikes,app.Data.Selected(1),app.Data.Selected(s));
16-
17+
app.Data.modifyList(end+1) = app.Data.Selected(s);
1718
%pushHistory(app,'m',app.Data.Selected(s),app.Data.Selected(1));
1819
end
1920
app.Data.modified = ones(1,length(app.Data.modified)); % one flag for each tab

@SplitMerge/plotAC.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ function plotAC(app,ax,ids)
4848
set(ax,'YLim',[0 ymax])
4949
xlabel(ax,'Time lag (ms)')
5050
ylabel(ax,'Autocorrelation (Hz)')
51+
grid(ax,'on');
5152
title(ax,['\color{' rpvCol '}' num2str(rpv) ' RPV' plural ' (' num2str((rpv/length(spiketimes))*100,'%2.2f') '%)'])
5253
end

@SplitMerge/plotDetectionCriterion.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function plotDetectionCriterion(app,ax,ids)
2828
line(ax,[1 1]*my_sign, get(ax,'YLim'),'LineStyle','--','Color',[0 0 0],'LineWidth',2);
2929

3030
set(ax,'XLim',sort([global_ex 0]));
31+
grid(ax,'on');
3132

3233
title(ax,['Estimated missing spikes: ' num2str(p*100,'%2.1f') '%']);
3334

@SplitMerge/plotFR.m

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,31 @@ function plotFR(app,ax,ids)
4444
yyaxis(ax,'right');
4545
cla(ax)
4646
memberwaves = app.Data.spikes.waveforms(ids,:);
47+
assigns = app.Data.spikes.assigns(ids);
48+
unq = unique(assigns);
4749
amp = range(memberwaves');
4850

51+
%{
4952
if isequal(app.Data.spikes.params.display.max_scatter, 'all')
5053
ind = 1:length(amp);
5154
else
5255
choice = randperm(length(amp));
5356
max_pos = min(length(amp), app.Data.spikes.params.display.max_scatter);
5457
ind = choice(1:max_pos);
5558
end
56-
l = scatter(ax,spiketimes(ind),amp(ind));
57-
set(l,'Marker','.','MarkerEdgeColor',[.3 .5 .3],'MarkerEdgeAlpha',0.4,'MarkerFaceAlpha',0.5)
59+
%}
60+
hold(ax,'on');
61+
for u = 1:length(unq)
62+
sub = assigns == unq(u); % If turning on the isequal clause above, this should be: sub = assigns(ind) == unq(u);
63+
col = unique(app.Data.spikes.assigns) == unq(u);
64+
scatter(ax,spiketimes(sub),amp(sub),20,'filled',...
65+
'MarkerEdgeColor',app.Data.colors(col,:),...
66+
'MarkerEdgeAlpha',0.4,'MarkerFaceAlpha',0.5,...
67+
'MarkerFaceColor',app.Data.colors(col,:));
68+
set(ax,'Xlim',tlims)
69+
end
70+
%l = scatter(ax,spiketimes(ind),amp(ind));
71+
%set(l,'Marker','.','MarkerEdgeColor',[.3 .5 .3],'MarkerEdgeAlpha',0.4,'MarkerFaceAlpha',0.5)
5872
set(ax,'Xlim',tlims)
5973
set(ax,'YLim',[0 max(amp)])
6074
xlabel(ax,'Time (s)')

@SplitMerge/plotUnits.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function plotUnits(app)
22
if app.Data.modified(1) || app.Data.doFirstPlot(1)
33
%TODO: we now store which cluster IDs have been modified in
4-
% app.Data.modifylist. We should only update those axes!
4+
% app.Data.modifyList. We should only update those axes!
55
app.Data.loader = uiprogressdlg(app.UIFigure,'Title','Please Wait',...
66
'Message','Loading clusters');
77
% Delete all previous spike panels

0 commit comments

Comments
 (0)