PATCH and FILL affect figure axes and graphics quality

13 visualizaciones (últimos 30 días)
Martin Dietz
Martin Dietz el 19 de Mayo de 2011
Dear all,
PATCH and FILL seem to affect the figure axes and graphics quality of a figure subsequently saved as a pdf or eps. Try generating the following figures and saving them as a pdf
1)
s = randn(1,501);
figure, plot([-100:400],s);
axis tight
2)
s = randn(1,501);
figure, plot([-100:400],s);
X = [100 100 150 150];
Y = [-(max(s)) (max(s)) (max(s)) -(max(s))];
patch(X,Y,'k','FaceAlpha',0.09,'EdgeAlpha',0.09);
axis tight
In the first plot, the axes are normal and the quality of the saved pdf is superb. In the plot using PATCH or FILL, the axes behave differently and the graphics quality of the pdf is dramatically affected.
Does anyone have a clue why this is happening ?
Best wishes, Martin

Respuestas (1)

Jan
Jan el 20 de Mayo de 2011
PATCH and FILL set the Renderer of the figure to "OpenGL", if the RendererMode is 'auto'. The Painters and ZBuffer renderers cannot display transparency, so your example needs OpenGL for rendering - and enables it automatically.
While PDFs contain scalable vector drawings with the Painters renderer, with OpenGL only pixel graphics are exported, which usually look less nice. Be aware, that there is no transparency property in the EPS format. Even the display of patches intersecting in 3D is not well defined. Therefore a pixel-graphics export is the best solution.
You can use the -r argument for PRINT to increase the resoltion.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by