Can export_fig or else draw vector graphics with transparent surfaces?
Ältere Kommentare anzeigen
Hi,
I used export_fig() to export an .eps image containing transparent surfaces, then inserted it in MS Word and converted to PDF by Adobe Acrobat, but in the final PDF, all transparency disappeared.
It's suggested here that only -opengl option can render transparent patch objects, unfortunately only for bitmaps. So is there any solution to export an vector graphic with transparent objects?
Antworten (1)
Mike Garrity
am 26 Jan. 2016
I'm sure that Yair (the author of export_fig) will show up at some point with some good advice, but my understanding is that export_fig goes through PostScript to get to all of the vector file formats. That's an issue in this case because the PostScript format does not support transparency, while PDF does. This means that the transparency gets lost because of going through PostScript.
If you're using R2014b or later, you might try using the print command instead. Starting in that release, the PDF writer doesn't go through PostScript, so it can support transparency.
[x,y,z] = sphere(12);
surf(x,y,z,'FaceAlpha',.5,'FaceColor',[.466 .674 .188],'EdgeColor','none')
camlight
print -dpdf print.pdf

It's got some issues of its own, but it might do what you need.
2 Kommentare
Qiu
am 26 Jan. 2016
Mike Garrity
am 26 Jan. 2016
Bearbeitet: Mike Garrity
am 26 Jan. 2016
That's because EPS is a PostScript format. PostScript doesn't support transparency.
Kategorien
Mehr zu Lighting, Transparency, and Shading finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!