5

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?

Amro
  • 123,847
  • 25
  • 243
  • 454
CaptainProg
  • 5,610
  • 23
  • 71
  • 116
  • 5
    Please include the code used to generate the plot – Dan Nov 06 '14 at 13:51
  • You probably want to remove the previous lines anyway. MATLAB uses vector graphics, so even data that is completely obscured still adds to the complexity and processing time of the figure. – Ben Voigt Nov 06 '14 at 14:46
  • For your particular application, you may want to use a single plot object with per-vertex color control. For that, see the section "Specifying edge colors" in the documentation for `patch`. – Ben Voigt Nov 06 '14 at 14:47

1 Answers1

0

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

chepyle
  • 976
  • 1
  • 9
  • 16