White artifacts in colorbar for PDF/EPS plots

17 views (last 30 days)
Hi,
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.
Alexander
  2 Comments
Alexander Engman
Alexander Engman on 14 Apr 2018
Still looking for an answer to this question.
Preetish Kakkar
Preetish Kakkar on 3 Jun 2018
Hi Alexander, we are actively working on fixing these white lines issues. We do expect colorbar white line to go away in 18b release. Please wait for 18b release and if the issue still persist, please update us.

Sign in to comment.

Accepted Answer

Jan
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
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...
colorbar.gif

Yin Song
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.
  2 Comments
Jan
Jan on 20 Nov 2019
It was me who blamed the PDF format and the PDF viewer. I'm not a member of the MathWorks team. I will apprciate a stable solution also.
Yin Song
Yin Song on 20 Nov 2019
Edited: Yin Song on 20 Nov 2019
Thanks for your clarification! My bad! I saw this reply a lot of times and thought it is an official reply from Matlab.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!