Why does my MATLAB plot refresh at unpredictable times even though 'EraseMode' is set to 'None'? For example: imax=100; map = jet(imax); ph = plot3(1,0,0,'b.','EraseMode','none','MarkerSize',8); axis([-2 2 -2 2 0 1]) axis('square') xlabel('x') ylabel('y') for i =1:imax, set(ph,'xdata',cos(2*pi*i/imax),'ydata',sin(2*pi*i/imax),'zdata',i/imax,'markerEdgeColor',map(i,:)); % pause drawnow end The plot should show a continuously growing spiral, but instead it refreshes at random points in the loop. This happens even when the "pause" statement is uncommented.
John Williams answered .
2025-11-20
A bug in MATLAB affects how the MarkerEdgeColor property handles color transitions between blue and cyan. Our development team is currently investigating this issue.
Switching to any colormap that avoids blue/cyan or cyan/blue transitions (such as pink, hot, cool, spring, or flag) resolves the problem.
To avoid this bug, do not change the MarkerEdgeColor property. Keeping this property constant ensures that the EraseMode functions correctly.
This advice can help you avoid issues with color transitions in MATLAB plots.