MATLAB: How to avoid white artifacts in the plots

artifactsfigureMATLABpainterspixelplotwhite

When making plots I always get white pixels/ artifacts in the plot, and I would like to avoid this. (Unfortunately I cannot reproduce this issue on other machines.) What could I do?

Best Answer

This kind of issue is usually related to the renderer settings in the figure. In some cases the default renderer 'Painters' doesn't work properly.
To work around this issue try to use 'ZBuffer' or 'OpenGL' as the renderer for the figure instead by using the following code:
set(gcf,'renderer','zbuffer')
% OR
set(gcf,'renderer','opengl')
Related Question