Finding a way to cleanly show double data points in a plot
Mostrar comentarios más antiguos
I want to make a residual plot like this one.

Matlabs plots dont show double data points in any way though, how can i fiks this?
right now i have created this plot by holding on and creating difrent plots with the same x value btw.
Respuestas (2)
crijn
el 3 de Oct. de 2023
1 voto
John D'Errico
el 3 de Oct. de 2023
Editada: John D'Errico
el 3 de Oct. de 2023
0 votos
You want to show two different points at different locations on the x axis. But currently you have them with the same values for x.
The answer is simple. You need to adjust the x coordinates the duplicate points will be plotted at. Yes, I know that you want MATLAB to know what you want it to do. But it cannot read your mind, and if MATLAB decided to plot points at locations other than where they were specified, then I am sure someone would start to scream about a bug, accompanied by a great deal of wailing and gnashing of teeth.
But you do not need this by hand. Simply search for duplicate points. You can use tools like diff and find to identify exact duplicates, although you may want to use a tolerance to identify them. Then just add and subtract some small number from each x value. Again, that is easily automated.
1 comentario
crijn
el 3 de Oct. de 2023
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!