Stata 15 help for graph_drop

[G-2] graph drop -- Drop graphs from memory

Syntax

Drop named graphs from memory

graph drop name [name ...]

Drop all graphs from memory

graph drop _all

name is the name of a graph currently in memory or the partial name of a graph in memory with the ? and * wildcard characters.

Menu

Graphics > Manage graphs > Drop graphs

Description

graph drop name drops (discards) the specified graphs from memory and closes any associated Graph windows.

graph drop _all drops all graphs from memory and closes all associated Graph windows.

Remarks

See [G-2] graph manipulation for an introduction to the graph manipulation commands.

Remarks are presented under the following headings:

Typical use Relationship between graph drop _all and discard Erasing graphs on disk

Typical use

Graphs contain the data they display, so when datasets are large, graphs can consume much memory. graph drop frees that memory. Graph is the name of a graph when you do not specify otherwise.

. graph twoway scatter faminc educ, ms(p)

. ...

. graph drop Graph

We often use graphs in memory to prepare the pieces for graph combine:

. graph ... , ... name(p1)

. graph ... , ... name(p2)

. graph ... , ... name(p3)

. graph combine p1 p2 p3, ... saving(result, replace)

. graph drop _all

Relationship between graph drop _all and discard

The discard command performs graph drop _all and more:

1. discard eliminates prior estimation results and automatically loaded programs and thereby frees even more memory.

2. discard closes any open dialog boxes and thereby frees even more memory.

We nearly always type discard in preference to graph drop _all if only because discard has fewer characters. The exception to that is when we have fit a model and still plan on redisplaying prior results, performing tests on that model, or referring to _b[], _se[], etc.

See [P] discard for a description of the discard command.

Erasing graphs on disk

graph drop is not used to erase .gph files; instead, use Stata's standard erase command:

. erase matfile.gph


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