append one graph to another
3 ビュー (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156959/image.jpeg)
Hi guys, How to append one graph to another? Tried using 'hold on' but it doesn't work. Thanks.
0 件のコメント
採用された回答
Azzi Abdelmalek
2014 年 2 月 18 日
編集済み: Azzi Abdelmalek
2014 年 2 月 18 日
Use plotyy
% Example
x=0:0.01:10
y1=sin(x)
y2=100*cos(x)
plotyy(x,y1,x,y2)
4 件のコメント
Azzi Abdelmalek
2014 年 2 月 19 日
Look at this example
close
clear
n=10
f=cos(0.1*(1:n)).^2
for k=n+1:n+10
fin1(k-n)=sin(0.1*k)
fin2(k-n)=cos(0.2*k)
end
plot(1:n,f,'b');
hold on
plot(n+1:n+10,fin1,'r')
plot(n+1:n+10,fin2,'r')
hold off
その他の回答 (1 件)
Mischa Kim
2014 年 2 月 19 日
You mean something along the lines of:
x1 = 1:50; x2 = 1:10; x3 = 1:10;
y1 = rand(1,50); y2 = rand(1,10); y3 = rand(1,10);
x = [x1 x2+x1(end) x3+x1(end)+x2(end)];
y = [y1 y2 y3];
plot(x,y)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Two y-axis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!