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

77 ビュー (過去 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.
  1 件のコメント
IM
IM 2020 年 8 月 7 日
Thank you so much !

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by