필터 지우기
필터 지우기

How to solve plotting different data in same figure when x-vectors are not the same?

조회 수: 2 (최근 30일)
Lizan
Lizan 2015년 3월 17일
편집: Lizan 2015년 3월 17일
Hi,
I am trying to plot 2 data in a plotyy(X1,Y1,X2,Y2) fashion. However the data x1 and x2 does not have the same timescale. Here data where x1, x2 is the time and y1 and y2 are two different kind of data. I like to plot them in same plot to show the correspondence reaction between them.
However x1 and x2 starts and ends at different times and I am not sure they share the same data points per second or per minute.
How do I solve this problem? How to plot x1, y1, x2, y2 in the same plot to compare when x-vectors and y-vectors are different? I like to compare the y-vectors.
  댓글 수: 1
Lizan
Lizan 2015년 3월 17일
편집: Lizan 2015년 3월 17일
Note! I'd like to plot the y1 and y2 data with different y-axis since the data is completely different in values and cannot be placed together with same y-axis.
This doesn't work:
>> plotyy(x1,y1,'b',x2,y2,'r')
Error using feval
Argument must contain a string or function_handle.
Error in plotyy>fevalfun (line 361)
Error in plotyy (line 61)

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

답변 (2개)

Arun Kumar
Arun Kumar 2015년 3월 17일
use "hold on" function

Ilham Hardy
Ilham Hardy 2015년 3월 17일
Does this work?
plot(x1,y1,x2,y2);

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by