How can I put a MATLAB figure in a presentation so that the slide background shows through?

2 次查看(过去 30 天)
Let's make a figure:
logo;
set(gcf, 'color', 'w');
alpha(0.7);
Doesn't that look nice. Now I'd like to place that figure in a slide of my presentation. I happen to be using Powerpoint, but I guess other people might be using a different package. Also, it's a flashy presentation and my slide background has some fancy graphics. I don't want the figure's frame (the white area in my example) to cover up the slide. Ideally I'd also like the background to show through the slightly transparent bits of the figure (in my example, the logo).
How can I achieve this?

采纳的回答

Jiro Doke
Jiro Doke 2011-2-3

export_fig by Oliver does this.

Excerpt from the help for export_fig:

For transparent background (and semi-transparent patch objects), set the figure (and axes) 'Color' property to 'none'; pdf, eps and png are the only file formats to support a transparent background, whilst the png format alone supports transparency of patch objects.

logo;
set(gcf, 'color', 'none');
alpha(0.7);
export_fig perfect_solution.png

Maybe Oliver can enlighten us on how he did it.

EDIT: Here's is an example of the exported image over a fancy, textured background:

(Image Source: http://sites.google.com/site/oliverwoodford/software/export_fig)

  1 个评论
Oliver Woodford
Oliver Woodford 2011-2-3
You can ascertain the transparency of a pixel by seeing how it changes as the background colour changes. I print the figure twice, with a black background and a white background, and compute the alphamatte from this.
Feel free to embed the relevant image from the examples web page in your answer, Jiro.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by