How can I avoid white artifacts in my plots?

D
Davidwilliams · Aug 17, 2020 · 2.3K views
Question
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 PhD Expert
Answered Aug 25, 2026

 

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')
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!