Moving graph along x-axis
Mostrar comentarios más antiguos
Hi,
I am trying to plot 3 different vectors that showcase the same function but with different starting points from the y-axis.

Now what I wanna do is move the yellow and the red graph so they overlap with the blue one, to see wether my determined data actually is correct. I have another picture here to further show what exactly I mean:

Now I have tried to do something similar but with the y-axis but unfortunately I couldn't make it work.
What would be a clever way to move the graphs without having to change the values of the vectors?
2 comentarios
Torsten
el 17 de Abr. de 2022
Now what I wanna do is move the yellow and the red graph so they overlap with the blue one, to see wether my determined data actually is correct.
Better work with the data, not with the graphics.
Sokratis Panagiotidis
el 19 de Abr. de 2022
Respuesta aceptada
Más respuestas (1)
Let's call your 3 data sets (x0,y0), (x1,y1), (x2,y2) where (x0,y0) are your target data points. Then I might try something like this:
x1_shifted=x1-mean(x1)+mean(interp1(y0,x0,y1));
x2_shifted=x2-mean(x2)+mean(interp1(y0,x0,y2));
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
