help graph drop dialog: graph drop
-------------------------------------------------------------------------------
Title
[G] graph drop -- Drop graphs from memory
Syntax
graph drop name [name ...]
graph drop _all
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] 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
Also see
Manual: [G] graph drop
Help: [G] graph manipulation; [P] discard, [D] erase