How to add " significant star " (*) to errorbar plot ?

149 次查看(过去 30 天)
Dear All,
I've created bar plot in the next way :
err = [ 0.2285767,0.2608904; 0.5362856,0.481496; 0.01711449,0.05935509; 0.08252063, 0.1091788];
y = [ 1.620632,1.804187; 3.129677, 2.815023; 0.9948397, 1.0550480; 1.120976, 1.233345 ];
figure
hBar= bar(y)
set(gca, 'XTickLabel', {'1' '2' '3' '4'});
hold on
ngroups = size(y, 1);
nbars = size(y, 2);
groupwidth = min(0.8, nbars/(nbars + 1.5));
for i = 1:nbars
x = (1:ngroups) - groupwidth/2 + (2*i-1) * groupwidth / (2*nbars);
errorbar(x, y(:,i), err(:,i), '.');
end
hold off
Can you help me please to add " significant star " (*) to errorbar plot above each comparing group ?
Thank you so much in advance!

回答(1 个)

Peng Li
Peng Li 2020-8-7
This can be added using text function. You simply fake it using text label. For example, text(x, y, '$\asterisk$', 'Interpretation', 'latex');
x and y specify the (x,y) on the axis apprepriately so that you can label this asterisk on top of error bar.
Similarly you can add dagger or ddagger signs to specify different significant levels if you want.

类别

Help CenterFile Exchange 中查找有关 Errorbars 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by