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

조회 수: 147 (최근 30일)
IM
IM 2020년 8월 7일
댓글: IM 2020년 8월 7일
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