How do I plot multiple lines on the same plot?

3 visualizaciones (últimos 30 días)
Lian
Lian el 17 de Mayo de 2014
Comentada: Walter Roberson el 18 de Mayo de 2014
So i have couple hundreds of lines and within each line, i have thousands of points that define the line. I have tried to use a loop and Hold to plot the lines, but the computing gets very slow, which i guess is due to the heavy use of memory to store all the lines at once. So i would like to know if there is a better way to plot them, for example don't show them at the same time, but still plotting in the same graph?
Thank you very much!
  2 comentarios
dpb
dpb el 17 de Mayo de 2014
Almost certainly the "thousands of points" is more than there are pixels to display them so first look at decimating the length.
It's faster to add to the ydata array directly than to use plot
Also, put them in an array and plot the array instead of individually.
These presume you have (or can create) a consistent x
Walter Roberson
Walter Roberson el 18 de Mayo de 2014
Are there the same number of points for every line? Are they all at the same x ?
How much zooming do you need to be doing?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by