How can I avoid white artifacts in my plots?

Illustration
Davidwilliams - 2020-08-17T12:34:17+00:00
Question: How can I avoid white artifacts in my plots?

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?

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

 

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')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!