Hi, I am having the following problem:
When I create a contourf plot and remove the lines between levels, as I try to print as .eps or .pdf, I end up with many unwanted white lines separating the levels. This does not happen when I print a .png or the number of levels is small.
I have reproduced the problem with the example for contourf given in Matlab website (https://www.mathworks.com/help/matlab/ref/contour.html), see code below.
The choice of colormap does not affect the result. However, I need to use colormap('grey'), and in that case the problem is even more obvious.
Thank you
clc, close all, clear allZ = peaks;colormap(gray);contourf(Z,linspace(min(min(Z)),max(max(Z)),30),'edgecolor','none')print('test','-dpdf');print('test','-depsc2');print('test','-dpng');disp('DONE')
Best Answer