White artifacts in colorbar for PDF/EPS plots
18 views (last 30 days)
I know this is a very common problem. I was using Matlab 2016b and experienced the problem that these white lines were cropping up my figure and the colorbar next to it. I read that this was supposed to be fixed in matlab 2017b, so I downloaded the newest version (2018a) and all the lines in my figure did actually disappear, which I am very happy about. However, the white diagonal line in my colorbar still appears. How do I fix this?
Thanks in advance.
Jan on 15 Apr 2018
The white diagonal line is not created by MATLAB, but by the PDF viewer. It vanishes, if you use e.g. display it with Acrobat reader and disable the checkbox in: Preferences -> Page Display -> Rendering -> Smooth line art.
This effect has been the same for many years now, see e.g. https://www.mathworks.com/matlabcentral/answers/15388-artifacts-in-figures-exported-as-pdf-from-matlab. For some of the effects MATLAB is responsible, but in your case it seems to be a problem of the viewer.
More Answers (2)
adajaga on 5 Sep 2019
The white diagonal line is very much created by MATLAB -- it is crazy that it has been there for years and no one ever fixed it. If you open the pdf in an editor like inkscape or illustrator you can see that. This is easily fixed by opening the figure in a vector graphics editor and removing the clipping mask that was used to create it.
For publication quality figures it is necessary to import MATLAB figures and edit them by hand. I still do this because MATLAB is very good for exploring and visualizing data. But there are decades old graphics bugs that could be easily fixed, so it does not seem to be a strength they are leaning into...
Yin Song on 17 Nov 2019
Is there any evidence that so many artifacts are created by pdf but not matlab? The old version of matlab (2009) does not have such problems and all other softwares like origin, python do not generate similar artifact when producing pdf figures. Why does matlab always blame pdf for such incompatibility problem? Furthermore, solutions to this problem provided by matlab are always the same for years and it never solves the problem for many people.
Without releasing further details, I would say blaming pdf by Matlab team is very sloppy and irresponsible.