I have a function interpolate whose output is a plot. And I have one more function piecewise whose output is also a plot. (They are coded by different people I just collected them). I want to these two plots in the same graph to see whose approximation is better. How to do it?

1 comentario

the cyclist
the cyclist el 9 de En. de 2017
Do you have the underlying data used to create those plots, or just the plots? For example, do you just have *.fig files?

Iniciar sesión para comentar.

Respuestas (1)

Stephen23
Stephen23 el 9 de En. de 2017
Editada: Stephen23 el 9 de En. de 2017

0 votos

The simplest way is to call hold on between the two plot calls:
plot(...)
hold on
plot(...)
hold off
It is also possible to extract the data from each line object, merge these int one array, and then plot them anew. You would need to get handles for the line objects, and use get to obtain the data values.

Categorías

Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de En. de 2017

Editada:

el 9 de En. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by