How do I plot many time series (iterated through in a for loop) on the same graph ?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
amen45
el 24 de Sept. de 2015
Comentada: the cyclist
el 25 de Sept. de 2015
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 comentarios
Respuesta aceptada
the cyclist
el 24 de Sept. de 2015
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 comentarios
Jon
el 25 de Sept. de 2015
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
el 25 de Sept. de 2015
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!