MATLAB: Deleting overlapping lines in a plot

image processing

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!

Best Answer

.fig files retain Children information of the figure; you can loop over the Children and delete based on color.