plotting, two graphs combined

How can I combine two graphs with different x axes and same y next to each other, i.e. I want to plot f vs a and f vs b and show them glued to each other side by side. What I am doing right now is plot them separately in Matlab then copy and paste into word and crop the left side of the second graph and glue to the right side of the first one. This is not really efficient. Thanks selis.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 27일

0 개 추천

Look at this example
t1=0:0.1:10;
t2=0:0.1:5;
y1=sin(t1);
y2=cos(t2);
v=[0.1 0.1 0.4 0.8 ;0.5 0.1 0.4 0.8]
subplot(1,2,1),h=plot(t1,y1,'r');
set(gca,'position',v(1,:))
set(gca,'ytick',[])
subplot(1,2,2),h=plot(t2,y2,'g');
set(gca,'position',v(2,:))

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2012년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by