White grid saving MATLAB plot as EPS or PDF
Asked Answered
S

2

7

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

Seasonal answered 2/2, 2011 at 20:54 Comment(1)
you might want to look into the available graphics renderers: mathworks.com/support/tech-notes/1200/1201.html, mathworks.com/help/techdoc/creating_plots/…Ofay
F
4

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')
Freon answered 2/2, 2011 at 23:19 Comment(2)
Great, that sorted it out. It also worked with setting the renderer to zbuffer, but it doesn't look as nice. Thanks!Seasonal
very useful! thumbupEgwin
D
1

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

Detent answered 9/9, 2013 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.