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

2 views (last 30 days)
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?

Accepted Answer

Jiro Doke
Jiro Doke on 3 Feb 2011

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 Comment
Oliver Woodford
Oliver Woodford on 3 Feb 2011
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.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!