MATLAB: Making all the plots to start from the same point.

want all of them to start from a specified point

I have four plots on a single graph. Each of those plots start from different points on the y axis. What do I do if I want all of them to start from a specified point so that I can see the pattern of my plots. I know I should add/subtract values from my y axis data so that they all start at the same point. But how do I do it?

Best Answer

x=1:10;
y1=1:10;
y2=10:10:100;
figure(1);plot(x,y1,'r',x,y2,'b');
figure(2);plot(x,y1,'r',x,y2-y2(1)+y1(1),'b');