
530 Accelerating MATLAB
®
Performance
10.1.2 Use Simple or No Plot Markers
Markers take extra time to render, so it makes sense to remove them if possible. However,
removing markers may detract from the visual clarity of the graph, so this should be
weighed against the performance benets on a case-by-case basis.
Even if we cannot remove the markers altogether, we might at least consider using
a simple marker (such as a dot or a plus) rather than a complex marker such as a star:
t = 0:0.01:10;
cla; hold('on'); drawnow
plot(t,sin(t)); drawnow % no markers
⇨ Elapsed time is 0.004385 seconds.
plot(t,sin(t),'.r'); drawnow % dot marker: 80% ...