White grid saving MATLAB plot as EPS or PDF

6.7k Views Asked by At

Whenever I save a pcolor or quiver plot as an EPS or PDF, I get this faint white grid that seems to be some sort of rendering problem. The first images shows the problem, the second one is how it looks in the figure window. I'm simply using the "Save As" menu item to save as an eps. Any suggestions on how I can get a nice looking vector image? I'm on OS X.

Thanks! Annoying ugly white grid

No white grid

2

There are 2 best solutions below

2
On BEST ANSWER

I can confirm the issue on Snow Leopard. Setting the render to opengl and using the 'Save As' menu to create an eps file from a quiver plot did solve the issue.

set(gcf, 'Renderer', 'opengl')
0
On

Just adding another solution: the white lines are not really errors but rather artifacts from the anti-aliasing settings of your EPS/PDF viewer. For some reason Matlab saves triangles instead of squares, thus invoking the anti-aliasing to straighten diagonal lines.

The artifacts disappear if triangles are replaced by rectangles as in http://www.mathworks.com/matlabcentral/fileexchange/43271-pcolor-eps-fix

Cheers