How to plot a excisting graph in a different figure on a certain position on the x-axis

Hi,
I've been searching for a couple of hours now, but can't seem to find.
I have two data sets x1 and y1, and x2 and y2. I want both datasets plotted in one figure. But there is a catch.....
If dataset 1 is plotted, I want dataset 2 to be plotted on a position, i.e. x1(a), given at for hand.
Could someone tell me if this is possible in Matlab?
Thanks in advanced.
Regards,
Tamara

답변 (2개)

You can give the dataset 2 an offset:
Edit
plot(x1,y1)
hold on
offset = x2(1)-x1(a);
plot(x2-offset,y2)
Tamara
Tamara 2011년 7월 28일
Hi Oleg,
Thanks for your quick reply.
But this doesn't work, this will only translate dataset 2 to a different position. I want dataset 2 plotted on x1(a).
So it has to look something like this: plot(x1,y1) hold on plot(x2,y2) @ x1(a)

댓글 수: 2

I hope now it's more clear what I meant, and if that's not what you need then please clarify.
Do you mean this:
plot(x1,y1);hold
plot(x2+x1(a),y2);

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

카테고리

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

질문:

2011년 7월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by