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

Re: st: transparent background with graph for powerpoint

From   Jacob Wegelin <>
Subject   Re: st: transparent background with graph for powerpoint
Date   Tue, 14 Apr 2009 17:20:29 -0400

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 background).

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 <> wrote:
> 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:

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