Skip to content

Commit

Permalink
allows mixing subjects and estimators
Browse files Browse the repository at this point in the history
  • Loading branch information
CPernet committed Jun 18, 2018
1 parent 9c14362 commit e5675f3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions limo_add_plots.m
Expand Up @@ -9,11 +9,11 @@
out = 0;
turn = 1;
current = pwd;
subjects_plot = 0;
electrode = [];

while out == 0

subjects_plot = 0;

%% Data selection
% ------------------
[file,path,index]=uigetfile('*mat',['Select Central tendency file n:' num2str(turn) '']);
Expand Down Expand Up @@ -77,24 +77,24 @@
elseif size(tmp,1) > 1 && size(tmp,3) == 1 % only 1 variable
Data = squeeze(tmp(:,:,1,:));
else
if subjects_plot == 1
v = inputdlg(['which subject to plot, 1 to ' num2str(size(tmp,3))],'plotting option');
if subjects_plot == 0
v = cell2mat(inputdlg(['which variable to plot, 1 to ' num2str(size(tmp,3))],'plotting option'));
else
v = inputdlg(['which variable to plot, 1 to ' num2str(size(tmp,3))],'plotting option');
if ~exist('v','var')
v = cell2mat(inputdlg(['which variable to plot, 1 to ' num2str(size(tmp,3))],'plotting option'));
end
end

if isempty(v)
if isempty(v)
out = 1; return
elseif strcmp(v,'mean')
Data = squeeze(nanmean(tmp,3));
else
try
v = str2num(cell2mat(v));
catch
v = eval(cell2mat(v));
else
if ischar(v)
v = eval(v);
end

if length(v)>1
if subjects_plot == 0 && length(v)>1
errordlg2('only 1 parameter value expected')
else
if size(tmp,1) == 1 && size(tmp,3) > 1
Expand Down Expand Up @@ -145,7 +145,7 @@
Data = squeeze(Data(1,:,:)); toplot = [];
else
if isempty(electrode)
electrode = inputdlg(['which electrode top plot 1 to' num2str(size(Data,1))],'electrode choice');
electrode = inputdlg(['which electrode to plot 1 to' num2str(size(Data,1))],'electrode choice');
end

if strcmp(electrode,'')
Expand Down Expand Up @@ -179,7 +179,11 @@
colorOrder = get(gca, 'ColorOrder');
colorindex = 1;
else
plot(timevect,Data(:,2)','Color',colorOrder(colorindex,:),'LineWidth',3);
if subjects_plot == 0
plot(timevect,Data(:,2)','Color',colorOrder(colorindex,:),'LineWidth',3);
else
plot(timevect,Data,'LineWidth',2);
end
assignin('base','plotted_data',Data(:,2)')
end

Expand Down Expand Up @@ -210,10 +214,6 @@
colorindex = 1;
end

if subjects_plot == 1;
out =1; return;
else
pause(1);
end
pause(1);
end

0 comments on commit e5675f3

Please sign in to comment.