Title for each table in one figure
Afficher commentaires plus anciens
Hi
I have a figure, where I have four tables. I could make a title for the hole figure, but I would like to make a title for each table. I have tried with uicontrol, where I have tried to make a text field with title, but I couldn't make it work. I have an example in the code for the first table. Someone can help? Sorry for the long code :-)
%% Bonferroni-Holm correction for ASSR amplitude
alpha = zeros(15,1);
n = 15;
for m = 1:15
alpha(m) = 0.05/n;
n = n-1;
end
fig = uifigure;
fig.Position = [0 440 1280 400];
VarName = {'PT' '1/6 oct' '1/3 oct' '1/2 oct' '1 oct' '2 oct'};
set(fig,'Name','Paired T-test: ASSR Amplitude, left upper: ipsilateral without BH correction, left lower: ipsilateral with BH correction , right upper: contralateral without BH correction, right lower: contralateral with BH correction');
% for amplitude for ipsilateral measurements without Bonferroni-Holm correction
p_amp_il_cor = unique(sort(p_amp_il(:)));
p_amp_il_cor(isnan(p_amp_il_cor)) = [];
T_il = array2table(p_amp_il,'VariableNames', VarName, 'RowNames', VarName);
uit11 = uitable(fig);
uit11.Data = T_il;
uit11.Position = [20 220 600 158];
% c = uicontrol('Style','text', 'Position', [20 380 600 10], 'String', 'ipsilateral without BH correction' );
% uicontrol(c);
s = uistyle('BackgroundColor','white');
addStyle(uit11,s);
styleIndices = ismissing(T_il);
[row,col] = find(styleIndices);
s = uistyle('BackgroundColor',[0.9 0.9 0.9], 'Fontcolor', [0.9 0.9 0.9]);
addStyle(uit11,s,'cell',[row,col]);
s = uistyle('Fontcolor', 'red');
for i = 1:size(p_amp_il,1)
for l =1:size(p_amp_il,2)
if p_amp_il(i,l) < 0.05
addStyle(uit11,s,'cell', [i,l])
end
end
end
% for amplitude for ipsilateral measurements with Bonferroni-Holm correction
uit21 = uitable(fig);
uit21.Data = T_il;
uit21.Position = [20 40 600 158];
s = uistyle('BackgroundColor','white');
addStyle(uit21,s);
styleIndices = ismissing(T_il);
[row,col] = find(styleIndices);
s = uistyle('BackgroundColor',[0.9 0.9 0.9], 'Fontcolor', [0.9 0.9 0.9]);
addStyle(uit21,s,'cell',[row,col]);
s = uistyle('Fontcolor', 'red');
for i = 1:size(p_amp_il,1)
for l =1:size(p_amp_il,2)
if ~isnan(p_amp_il(i,l))
elem = find(p_amp_il_cor == p_amp_il(i,l));
if p_amp_il_cor(elem) < alpha(elem)
addStyle(uit21,s,'cell', [i,l])
end
end
end
end
% for amplitude for contralateral measurements without Bonferroni-Holm correction
p_amp_cl_cor = unique(sort(p_amp_cl(:)));
p_amp_cl_cor(isnan(p_amp_cl_cor)) = [];
T_cl = array2table(p_amp_cl,'VariableNames', VarName, 'RowNames', VarName);
uit12 = uitable(fig);
uit12.Data = T_cl;
uit12.Position = [660 220 600 158];
s = uistyle('BackgroundColor','white');
addStyle(uit12,s);
styleIndices = ismissing(T_cl);
[row,col] = find(styleIndices);
s = uistyle('BackgroundColor',[0.9 0.9 0.9], 'Fontcolor', [0.9 0.9 0.9]);
addStyle(uit12,s,'cell',[row,col]);
s = uistyle('Fontcolor', 'red');
for i = 1:size(p_amp_cl,1)
for l =1:size(p_amp_cl,2)
if p_amp_il(i,l) < 0.05
addStyle(uit12,s,'cell', [i,l])
end
end
end
% for amplitude for contralateral measurements with Bonferroni-Holm correction
uit22 = uitable(fig);
uit22.Data = T_cl;
uit22.Position = [660 40 600 158];
s = uistyle('BackgroundColor','white');
addStyle(uit22,s);
styleIndices = ismissing(T_cl);
[row,col] = find(styleIndices);
s = uistyle('BackgroundColor',[0.9 0.9 0.9], 'Fontcolor', [0.9 0.9 0.9]);
addStyle(uit22,s,'cell',[row,col]);
s = uistyle('Fontcolor', 'red');
for i = 1:size(p_amp_il,1)
for l =1:size(p_amp_cl,2)
if ~isnan(p_amp_cl(i,l))
elem = find(p_amp_cl_cor == p_amp_cl(i,l));
if p_amp_cl_cor(elem) < alpha(elem)
addStyle(uit22,s,'cell', [i,l])
end
end
end
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Labels and Styling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!