From 5f210408c70975dd00070efe08010bf0b10f0642 Mon Sep 17 00:00:00 2001 From: Florian Vollrath Date: Wed, 5 Oct 2016 14:58:49 +0200 Subject: [PATCH] final --- alternativePlot.m | 11 ++++++++--- main.m | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/alternativePlot.m b/alternativePlot.m index a8e9875..526b7ae 100644 --- a/alternativePlot.m +++ b/alternativePlot.m @@ -116,7 +116,7 @@ b = uicontrol('Parent',f,'Style','slider',... 'value',0, 'min',0, 'max', ceil(size(cell_sig_merged,2)/clusterSize),... 'SliderStep', [1 1]/(ceil(size(cell_sig_merged,2)/clusterSize)),'Callback', @redrawPlot); - +align(b, 'center'); function redrawPlot(source,~) val = round(source.Value); @@ -235,9 +235,14 @@ function redrawPlot(source,~) else + if val == ceil(size(cell_sig_merged,2)/clusterSize) + iStart = (val - 1) * clusterSize + 1; + iEnd = subPlotCols; + else + iStart = (val - 1) * clusterSize + 1; + iEnd = clusterSize * val; + end - iStart = (val - 1) * clusterSize + 1; - iEnd = clusterSize * val; %plot package of clusterSize tempImage = zeros(size(ica_segments, 2), size(ica_segments, 3), 3); diff --git a/main.m b/main.m index 901b10d..9fc48e5 100644 --- a/main.m +++ b/main.m @@ -98,7 +98,7 @@ sweepDuration = 10; %number of time courses to show when slide bar is used -clusterSize = 5; +clusterSize = 10; cell_sig_merged = alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx, data_r, frames, fileNamesGreen, clusterSize, sweepDelay, sweepInterval, numberOfSweeps, sweepDuration);