MATLAB R2014b: Rendering plots with lines in the same place

328 Views Asked by At

Since version R2014b, MATLAB now renders graphics nicely anti-aliased (finally!)

However, this causes a glitch in the way it displays some of my figures. If I plot a line, use hold on and then plot another line in exactly the same place with a different colour, the line appears in a mottled combination of both colours. In the past, the line would simply appear as the last colour that was plotted in that location.

Here's an example of a trace in blue, with some sections (the steeper bits) showing a green line. In previous MATLAB versions, the green lines would be continuous, but now some of the blue line shows through.

enter image description here

Is there a neat way to work around this in the new version, or do I have to ensure that I remove any existing lines before plotting in the same place?

1

There are 1 best solutions below

0
On

When overplotting, the new anti aliasing plots can have some bleed through, try

set(gcf,'GraphicsSmoothing','off')

To see if it restores the functionality you're used to.

Ref: http://www.mathworks.com/matlabcentral/answers/157758-how-do-i-turn-off-antialiasing-in-matlab-r2014b