필터 지우기
필터 지우기

How do I plot many time series (iterated through in a for loop) on the same graph ?

조회 수: 4 (최근 30일)
I'm trying to do a visual comparison of a data set (n=302) on the same graph. Each file is a time series that undergoes modification within a for loop and is plotted within each iteration. Using hold hasn't been effective across iterations, and I'd like to have all of the time series plotted on the same graph. Is this possible?
  댓글 수: 3
amen45
amen45 2015년 9월 24일
for one iteration it's held but then figures start popping up 1 at a time with each time series plotted individually. They are never plotted on the same graph.

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

채택된 답변

the cyclist
the cyclist 2015년 9월 24일
Here is a silly example of "hold on" working just fine. What are you doing differently?
figure
hold on
for i = 1:100
pause(1/i)
plot(rand(1,10))
end
(The pausing is unnecessary. It is just to show the lines getting draw one after the other.)
  댓글 수: 3
Jon
Jon 2015년 9월 25일
Holding within the for loop should be fine. It sounds like you were putting the "figure" command in the for loop, which will generate a new figure each iteration.
the cyclist
the cyclist 2015년 9월 25일
Well, if he put just "hold" -- not "hold on" -- inside a for loop, it will toggle the hold on and off each iteration, and would miss all but the last plot or two.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by