Multiple plots with time series object

조회 수: 7 (최근 30일)
Camilo Andrés Roca Duarte
Camilo Andrés Roca Duarte 2011년 5월 22일
Hi everyone I am trying to plot two different time series objects in the same plot. The object have different units, so I tough using a 'plotyy' command but, it gives me an error because there are not enough arguments. The time index of the objects is similar i,e. in the same day, but they are from different data. If anybody knows how to plot two different time series object with two y axis, please tell me.
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2011년 5월 22일
[ax, h1, h2] = plotyy(x1, y1, x2, y2);
datetick(ax[1], 'y', 'HH:MM', 'keeplimits');
datetick(ax[2], 'y', 'HH:MM', 'keeplimits');
  댓글 수: 1
Camilo Andrés Roca Duarte
Camilo Andrés Roca Duarte 2011년 5월 22일
That's a way to do it, but it's not the way i want to do it. It is true that i can use the datetick command to put the date in the x-axis, but if i do that, when you zoom in the graphic it doesnt show you the date with more resolution. If you use the command plot(tsobject) with tsobject a time series object, it will automatically put the x-axis in the 'hh:mm:ss' format and if you zoom it will not loose resolution. I want to do that but with two different time series object, i.e. one has units of 'Volts' in the y-axis, while the other one has units of 'km' in the y-axis but the use the same format for the x axis (hh:mm:ss). I cant use the plotyy command like i used the plot command because i dont have enough arguments (the x1 and x2). I hope this clarify my question a litle more.
Thanks

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

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by