Note: This FAQ is for editing Stata 9 graphs in Microsoft Word 97 (or later versions).
How can I edit a Stata graph in Microsoft Word?
How to edit a Stata graph in Microsoft Word
Jens M. Lauritsen
- Make sure you have the wmf import filter installed in Word (usually,
this feature is already installed).
- Make sure graph options in Stata are set (copy format wmf, with
color/black white, lines etc.). Also check if the copy and print
options are set as you like in the graph preferences on the appearances
- Create your graph in
Stata, and then copy it to the clipboard. Copy graph
(Ctrl+C) or export to wmf file using
. translate figure.gph figure.wmf
- Start Word.
- Import Graph into Word as a wmf from file by pulling down Insert
and choosing Picture - from file, or use Paste from the
- Right click on the picture and select Edit Picture.
- Open the Drawing toolbar, if not already open.
- Put your mouse in the middle of the graph and "ungroup" the whole
content. To do this, click Draw on the drawing toolbar and
choose Ungroup from the menu. (This can also be done with a
right click of your mouse.) If the Ungroup option is not
highlighted, then the drawing is already "ungrouped".
- Click outside of the graph to unselect all the objects auto
selected by the ungroup procedure.
- Click the pointing device (the arrow on the left-hand side of the
drawing toolbar), and encircle the objects you want to change, move, or
delete. Sometimes, the background of the graph can interfere with this
procedure. If this happens, click and start your selection somewhere
just outside of the graph.
- Make the changes to the graph. This process can be used to change the
font, change the line thickness, add lines, add text, remove an axis
completely, and/or remove tickmarks or whatever else the user wishes.
- Note: After you import the graph, during editing the vertical
axis labels may be automatically changed by Word to contain horizontal
text. This can easily be fixed. If you click on the "horizontal" text
once, the textbox is highlighted. The direction of text can then be
changed in two ways: 1) From the "Format" menu, choose "text
direction" and change to the original vertical direction; and 2) If,
when you highlight the label, a toolbar appears, the last button on the
toolbar can be used to rotate the text to the original format (This
toolbar may not appear on older versions of Word).
Raw Stata graph File:
Stata graph after editing: