필터 지우기
필터 지우기

Add title and axis to subplot

조회 수: 2 (최근 30일)
Yung Xi
Yung Xi 2019년 10월 24일
편집: Yung Xi 2019년 10월 24일
Hello,
I have made a subplot (3 row, 1 column) using this code for x between 1 and 50
A = (x);
subplot(3,1,1)
fplot(A,[1 50])
B = (x);
subplot(3,1,2)
fplot(B,[1 50])
C = (x);
subplot(3,1,3)
fplot(C,[1 50])
How do I also add a title f
  댓글 수: 2
Adam
Adam 2019년 10월 24일
doc title
adds titles to plots, surprisingly enough.
To change linie colour, keep hold of the return argument from the call to fplot and use that. It has a 'Color' property.
dpb
dpb 2019년 10월 24일
Same as if you only had one plot for each subplot...just follow the fplot call with the additional calls to customize like title, legend, etc. fplot like plot also accepts a 'linespec' triplet to set color or line style.
See the doc and examples for each...

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

답변 (1개)

Kagan Eröz
Kagan Eröz 2019년 10월 24일
A = @(x) sin(x);
s(1) = subplot(3,1,1)
fplot(A,[1 50],'g')
B = @(x) cos(x);
s(2) = subplot(3,1,2)
fplot(B,[1 50],'m')
C = @(x) tan(x);
s(3) = subplot(3,1,3)
fplot(C,[1 50])
Titles = {'Top Plot1','Top Plot2','Top Plot3'};
for i=1:max(size(Titles))
title(s(i),Titles(1));
end

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by