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

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

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개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by