Hello, I would like to plot a graph like this. Can anyone help me in writing this code?
Thank you so much

댓글 수: 3

Dyuman Joshi
Dyuman Joshi 2023년 3월 31일
편집: Dyuman Joshi 2023년 3월 31일
Refer to bar, there are plenty of examples as well.
Francesco Marchione
Francesco Marchione 2023년 3월 31일
There is no example how to write tau and sigma and submarks like 1, 2 , 3
Dyuman Joshi
Dyuman Joshi 2023년 3월 31일
편집: Dyuman Joshi 2023년 3월 31일

댓글을 달려면 로그인하십시오.

 채택된 답변

Antoni Garcia-Herreros
Antoni Garcia-Herreros 2023년 3월 31일

0 개 추천

Hello Francesco,
You can refer to this thread for more info, but this should do the trick
close all
data=[2,3;2,6;2,6;2,6];
ax=axes;
b=bar(data);
ylim([0 12])
L1 = ["Mu" "Tau"];
a3=[b(1).XEndPoints; b(2).XEndPoints];
x3=a3(:)';
yp1 = -0.5*ones(size(x3));
yp2 = 2.5*yp1;
ax.XTickLabel={''};
for i=1:2:numel(x3)
text(x3(i)-0.08, yp1(i), L1(1))
text(x3(i+1)-0.08, yp1(i), L1(2))
end
L2=['1' '2' '3' '4'];
for i=1:4
text(i, yp2(i), L2(i))
end

추가 답변 (0개)

카테고리

제품

릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by