[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: transparent background with graph for powerpoint

Subject   RE: st: transparent background with graph for powerpoint
Date   Wed, 15 Apr 2009 08:34:48 +0100

I have found that a graph with a transparent background can be created on a
PC from Stata 9 in PowerPoint as follows:

1. In Stata select the graph export command to export the graph to a .wmf
file type e.g:  graph export C:\Data\Graphs\filename.wmf, replace
2. Select Insert then Picture and navigate to insert the graph filename.wmf
into PowerPoint
3. Right click and select Edit Picture
4. When asked if you want to convert to a  MS drawing object, select yes
5. Select the graph and fully ungroup the objects in the graph
6. Select a blank space in the graph, and when an area object is highlighted
with the handles (usually it is rectangular) delete the object selected
7. Repeat process 6 to remove all such area objects (usually  2 to 3 layers
need to be removed)
8. Select an object in the graph and regroup fully.
Note: Combination graphs have area objects for each graph combined, so
select areas to delete in each combined graph row and column.
Note: This general procedure can be used to edit any object in a graph.
Note: To check that regroup has captured all objects you can delete the
graph to see nothing is left behind, then  undo the delete to return the
Note: If the graph area is too large for the slide after inserting into
PowerPoint, double left click the graph, in the Format Picture dialog box
select the size tab, then select smaller height and width values (beforehand
lock the aspect ratio if not already locked).

See if this works for you.
Geoffrey Livesey B.Sc., Ph.D., R.P.H.Nutr. 
Registered Public Health Nutritionist
Intelligent Nutrition and Health Research and Review
Commissioned by Industry, Government, and Academia
Member of SENSE, Professional Nutrition Consultants
Member of ACUMENTIA, Professional Bioscience Consultants

Limited Company registered in England and Wales Number 4991400
VAT Registration Number GB 731 9065 38
Tel:       +44-1953-606689
Mobile:  +44-7990-964609 
Fax:      +44-1953-600218
A:         Pealerswell House
            21 Bellrope Lane
            NR18 OQX
            United Kingdom

-----Original Message-----
[] On Behalf Of Jacob Wegelin
Sent: 14 April 2009 22:20
Subject: Re: st: transparent background with graph for powerpoint

In case anybody else is interested in this question, here is an answer that
Stata Tech Support emailed to me today:

There isn't an option in Stata that will allow you to create a "clear"
background for graphs.  However, I have seen users add a picture or scene as
the background with third-party programs such as PhotoShop.

You can try the following instructions in PhotoShop to place a graph on a
picture background:

Open Stata graph in PhotoShop.  Place graph in its own layer (not

Select magic wand and in the magic wand options, set tolerance to 0, uncheck
anti-aliasing, check contiguous.

Select background.  If all of background not selected, select Similar from
the Select menu.  Delete selection.

Place background image in layer below Stata graph.

If you're looking to match the background to a specific color, Stata graphs
will take RBG values in addition to the preset colors listed.  For example:

. twoway (scatter x4 x3), graphregion(fcolor(212 55 155))

Hope this helps.

It's possible that the transparent feature could be made available in a
future release, but there hasn't been anything mentioned specifically for an
update, etc.

On Sun, Apr 12, 2009 at 2:59 PM, Jacob Wegelin <>
> Consider a graph created in Stata on a MacBook Pro. Is there a way to 
> put this graph into Powerpoint so that the Powerpoint background (a 
> texture, an image, a color, etc.) shows through?
> sysuse auto, clear
> twoway (scatter price mpg), aspectratio(1) graphregion(color(none)) 
> graph export junk.pdf, replace graph export junk.eps, replace
> graph export junk.tif, replace
> Within Powerpoint, when I Insert -> Picture and then insert either 
> junk.eps or junk.tif, the plot covers up ("whites out") the background 
> texture all the way through the outer graph region.  When I insert 
> junk.pdf, only the inner plot region whites out the texture. Thus none 
> of these approaches allows the background to show through the 
> "non-inked" portions of the plot. (And for display, one cannot export 
> directly to pdf on a Mac because smooth curves are somehow corrupted 
> in the export process.)
> A thread from 2004 (see below) suggests that this might be a Macintosh 
> problem; if I did this on a PC would the graph be transparent? But 
> better yet: Is there a way to do this on a Mac?
> Thanks for any insight
> Jacob A. Wegelin
> Assistant Professor
> Department of Biostatistics
> Virginia Commonwealth University
> 730 East Broad Street Room 3006
> P. O. Box 980032
> Richmond VA 23298-0032
> U.S.A.
> E-mail:
> URL:
> From      Fredrik Wallenberg <>
> To
> Subject   Re: RE: st: Re: Transparent background in graphics Date      
> Thu, 20 May 2004 10:54:14 -0700
>  Thank you, that is excellent news. As I said earlier, it is quite 
> easy to edit out the background of an eps or pdf file using Adobe 
> Illustrator, so at least that is a workaround for now. The PDF format 
> does support transparency, so that should work. However, as long as 
> you are relying on Apple's built in "print-to-pdf" functionality you 
> will be stuck with a white background (since the graphic is actually 
> printed onto a white "paper"). If you actually implement a true "save 
> as pdf" functionality into Stata you should be fine.
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index