Stata 15 help for graph_save

[G-2] graph save -- Save graph to disk


graph save [graphname] filename [, asis replace]


graph save saves the specified graph to disk. If graphname is not specified, the graph currently displayed is saved to disk in Stata's .gph format.

If filename is specified without an extension, .gph is assumed.


asis specifies that the graph be frozen and saved as is. The alternative -- and the default if asis is not specified -- is live format. In live format, the graph can be edited in future sessions, and the overall look of the graph continues to be controlled by the chosen scheme (see [G-4] schemes intro).

Say that you type

. scatter yvar xvar, ... . graph save mygraph

which will create file mygraph.gph. Suppose that you send the file to a colleague. The way the graph will appear on your colleague's computer might be different from how it appeared on yours. Perhaps you display titles on the top, and your colleague has set his scheme to display titles on the bottom. Or perhaps your colleague prefers y axes on the right rather than on the left. It will still be the same graph, but it might look different.

Or perhaps you just file away mygraph.gph for use later. If the file is stored in the default live format, you can come back to it and change the way it looks by specifying a different scheme, and you can edit it.

If, on the other hand, you specify asis, the graph will forever look just as it looked the instant it was saved. You cannot edit it, and you cannot change the scheme. If you send the as-is graph to colleagues, they will see it exactly in the form that you see it.

Whether a graph is saved as-is or live makes no difference for printing. As-is graphs usually require fewer bytes to store, and they generally display more quickly, but that is all.

replace specifies that the file may be replaced if it already exists.


You may instead specify that the graph be saved at the instant you draw it by specifying the saving(filename[, asis replace]) option; see [G-3] saving_option.

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