White lines in 2D figure when exporting it

Hi,
I am using (in Matlab2018b, MacbookPro 2019 with macOS Catalina):
pcolor(xdata,ydata,zdata));
colorbar
shading interp
colormap(hsv);
colorbar
and the figure I get is a perfect 2D plot.
Now, when I want to save it (in any format, I have tried eps, pdf, png...), I get these anoying white lines you can see in the attachment.
When I copy the figure in my report the lines are even more accused.
Thanks in advance for your help.

 Accepted Answer

ME
ME on 27 Nov 2019
There isn't an accepted answer, but the following question has a lot of potential pointers that might be of use.

4 Comments

Thanks, but unfortunately none of those solutions work for me :(
Personally, I've always struggled with this when saveing to eps. I've never has an issue when i use "File -> Export Setup..." and set the options in the rendering tab to the following:
  • Colorspace: RGB color
  • (checked tick box) Custom color: w
  • (unchecked tick box) Custom rendered: painters (vector format)
  • Resolution (dpi): 600
  • (checked tick box) Keep axis limits
  • (checked tick box) Show uicontrols
I then go to "Export..." and save as a png.
That always does the trick and the figure is usually high enough resolution as to be able to use some other program (e.g. inkscape) to save the resulting image as an eps or pdf without suffering the white lines - if you really need to save to one of those file formats. I know this won't produce the same lossless images as the pdf/eps would normally but it's always been a pretty decent alternative.
Awesome, it works!
Thank you very much!
No problem. I'm sure there must be a "nicer" way of doing it but I've ended up doing it this way hundreds of times!

Sign in to comment.

More Answers (0)

Asked:

on 27 Nov 2019

Commented:

ME
on 27 Nov 2019

Community Treasure Hunt

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

Start Hunting!