MATLAB: Does the MATLAB plot refresh at unpredicatable times even though ‘EraseMode’ is set to ‘None’

changeerasemodeMATLABnoneplotrefreshupdate

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.

Best Answer

This is a bug in MATLAB in the way that markerEdgeColor handles color changes between blue and cyan. Our development staff is investigating this issue.
Changing 'map' to any colormap that does not include a blue/cyan or cyan/blue transition (pink, hot, cool, spring, flag) eliminates the problem.
As a workaround for this problem, do not try to change the 'MarkerEdgeColor' property. Keeping this property constant causes 'EraseMode' to behave properly.