Deleting overlapping lines in a plot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hans Sunaryanto
el 19 de Ag. de 2019
Comentada: Chris
el 23 de Ag. de 2019
Hi all,
I have a .fig file that is made up of red and black lines and I want to be able to export this as .pdf. Plot twist: Each of the red lines shown here has an underlying black line that I want to just get rid of, so it results in only purely-black and purely-red lines. Any idea how to solve this?
Thanks!
1 comentario
Respuesta aceptada
Chris
el 19 de Ag. de 2019
.fig files retain Children information of the figure; you can loop over the Children and delete based on color.
5 comentarios
Chris
el 23 de Ag. de 2019
You will need to then loop over all combinations of red and black lines testing for pairs.
The pair test: If the end points of the overlapping lines are coincident you can do a distance test on each end. Else you can try using polyfit to determine if the two lines have the same slope and y-intercept.
Or if you have a small number of plots and lines you can loop over each black line, make the line a new color and used input() to specify if that line should be deleted; if not restore its color
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!