File: Manipulation-of-Plot-Windows.html

package info (click to toggle)
octave 10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 145,388 kB
  • sloc: cpp: 335,976; ansic: 82,241; fortran: 20,963; objc: 9,402; sh: 8,756; yacc: 4,392; lex: 4,333; perl: 1,544; java: 1,366; awk: 1,259; makefile: 659; xml: 192
file content (395 lines) | stat: -rw-r--r-- 26,839 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Manipulation of Plot Windows (GNU Octave (version 10.3.0))</title>

<meta name="description" content="Manipulation of Plot Windows (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Manipulation of Plot Windows (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="High_002dLevel-Plotting.html" rel="up" title="High-Level Plotting">
<link href="Use-of-the-_0022interpreter_0022-Property.html" rel="next" title="Use of the &quot;interpreter&quot; Property">
<link href="Manipulation-of-Plot-Objects.html" rel="prev" title="Manipulation of Plot Objects">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<div class="subsection-level-extent" id="Manipulation-of-Plot-Windows">
<div class="nav-panel">
<p>
Next: <a href="Use-of-the-_0022interpreter_0022-Property.html" accesskey="n" rel="next">Use of the &quot;interpreter&quot; Property</a>, Previous: <a href="Manipulation-of-Plot-Objects.html" accesskey="p" rel="prev">Manipulation of Plot Objects</a>, Up: <a href="High_002dLevel-Plotting.html" accesskey="u" rel="up">High-Level Plotting</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Manipulation-of-Plot-Windows-1"><span>15.2.7 Manipulation of Plot Windows<a class="copiable-link" href="#Manipulation-of-Plot-Windows-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-plotting_002c-window-manipulation"></a>

<p>By default, Octave refreshes the plot window when a prompt is printed,
or when waiting for input.  The
<code class="code">drawnow</code> function is used to cause a plot window to be updated.
</p>
<a class="anchor" id="XREFdrawnow"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-drawnow"><span><strong class="def-name">drawnow</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-drawnow"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-drawnow-1"><span><strong class="def-name">drawnow</strong> <code class="def-code-arguments">(&quot;expose&quot;)</code><a class="copiable-link" href="#index-drawnow-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-drawnow-2"><span><strong class="def-name">drawnow</strong> <code class="def-code-arguments">(<var class="var">term</var>, <var class="var">file</var>, <var class="var">debug_file</var>)</code><a class="copiable-link" href="#index-drawnow-2"> &para;</a></span></dt>
<dd><p>Update figure windows and their children.
</p>
<p>The event queue is flushed and any callbacks generated are executed.
</p>
<p>With the optional argument <code class="code">&quot;expose&quot;</code>, only graphic objects are
updated and no other events or callbacks are processed.
</p>
<p>The third calling form of <code class="code">drawnow</code> is for debugging and is
undocumented.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFrefresh">refresh</a>.
</p></dd></dl>


<p>Only figures that are modified will be updated.  The <code class="code">refresh</code>
function can also be used to cause an update of the current figure, even if
it is not modified.
</p>
<a class="anchor" id="XREFrefresh"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-refresh"><span><strong class="def-name">refresh</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-refresh"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-refresh-1"><span><strong class="def-name">refresh</strong> <code class="def-code-arguments">(<var class="var">h</var>)</code><a class="copiable-link" href="#index-refresh-1"> &para;</a></span></dt>
<dd><p>Refresh a figure, forcing it to be redrawn.
</p>
<p>When called without an argument the current figure is redrawn.  Otherwise,
the figure with graphic handle <var class="var">h</var> is redrawn.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFdrawnow">drawnow</a>.
</p></dd></dl>


<p>Normally, high-level plot functions like <code class="code">plot</code> or <code class="code">mesh</code> call
<code class="code">newplot</code> to determine whether the state of the target axes should be
initialized (the default) or if subsequent plots should be drawn on top of
previous ones.  To have two plots drawn over one another, use the <code class="code">hold</code>
function or manually change the axes <a class="ref" href="Axes-Properties.html#XREFaxesnextplot">nextplot</a>
property.  For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">hold on;
x = -10:0.1:10;
plot (x, sin (x));
plot (x, cos (x));
hold off;
</pre></div></div>

<p>displays sine and cosine waves on the same axes.  If the hold state is
off, consecutive plotting commands like this will only display the last
plot.
</p>
<a class="anchor" id="XREFnewplot"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-newplot"><span><strong class="def-name">newplot</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-newplot"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-newplot-1"><span><strong class="def-name">newplot</strong> <code class="def-code-arguments">(<var class="var">hfig</var>)</code><a class="copiable-link" href="#index-newplot-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-newplot-2"><span><strong class="def-name">newplot</strong> <code class="def-code-arguments">(<var class="var">hax</var>)</code><a class="copiable-link" href="#index-newplot-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-newplot-3"><span><code class="def-type"><var class="var">hax</var> =</code> <strong class="def-name">newplot</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-newplot-3"> &para;</a></span></dt>
<dd><p>Prepare graphics engine to produce a new plot.
</p>
<p>This function is called at the beginning of all high-level plotting
functions.  It is not normally required in user programs.  <code class="code">newplot</code>
queries the <code class="code">&quot;NextPlot&quot;</code> field of the current figure and axes to
determine what to do.
</p>
<table class="multitable">
<thead><tr><th width="25%">Figure NextPlot</th><th width="75%">Action</th></tr></thead>
<tbody><tr><td width="25%"><code class="code">&quot;new&quot;</code></td><td width="75%">Create a new figure and make it the current figure.</td></tr>
<tr><td width="25%"><code class="code">&quot;add&quot;</code> (default)</td><td width="75%">Add new graphic objects to the current
figure.</td></tr>
<tr><td width="25%"><code class="code">&quot;replacechildren&quot;</code></td><td width="75%">Delete child objects whose
HandleVisibility is set to <code class="code">&quot;on&quot;</code>.  Set NextPlot property to
<code class="code">&quot;add&quot;</code>.  This typically clears a figure, but leaves in place hidden
objects such as menubars.  This is equivalent to <code class="code">clf</code>.</td></tr>
<tr><td width="25%"><code class="code">&quot;replace&quot;</code></td><td width="75%">Delete all child objects of the figure and
reset all figure properties to their defaults.  However, the following
four properties are not reset: Position, Units, PaperPosition, PaperUnits.
This is equivalent to <code class="code">clf reset</code>.</td></tr>
</tbody>
</table>

<table class="multitable">
<thead><tr><th width="25%">Axes NextPlot</th><th width="75%">Action</th></tr></thead>
<tbody><tr><td width="25%"><code class="code">&quot;add&quot;</code></td><td width="75%">Add new graphic objects to the current axes.  This
is equivalent to <code class="code">hold on</code>.</td></tr>
<tr><td width="25%"><code class="code">&quot;replacechildren&quot;</code></td><td width="75%">Delete child objects whose
HandleVisibility is set to <code class="code">&quot;on&quot;</code>, but leave axes properties
unmodified.  This typically clears a plot, but preserves special settings
such as log scaling for axes.  This is equivalent to <code class="code">cla</code>.</td></tr>
<tr><td width="25%"><code class="code">&quot;replace&quot;</code> (default)</td><td width="75%">Delete all child objects of the
axes and reset all axes properties to their defaults.  However, the
following properties are not reset: Position, Units.  This is equivalent
to <code class="code">cla reset</code>.</td></tr>
</tbody>
</table>

<p>If the optional input <var class="var">hfig</var> or <var class="var">hax</var> is given then prepare the
specified figure or axes rather than the current figure and axes.
</p>
<p>The optional return value <var class="var">hax</var> is a graphics handle to the created
axes object (not figure).
</p>
<p><strong class="strong">Caution:</strong> Calling <code class="code">newplot</code> may change the current figure and
current axes.
</p></dd></dl>


<a class="anchor" id="XREFhold"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-hold"><span><strong class="def-name">hold</strong><a class="copiable-link" href="#index-hold"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hold-1"><span><strong class="def-name">hold</strong> <code class="def-code-arguments">on</code><a class="copiable-link" href="#index-hold-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hold-2"><span><strong class="def-name">hold</strong> <code class="def-code-arguments">off</code><a class="copiable-link" href="#index-hold-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hold-3"><span><strong class="def-name">hold</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-hold-3"> &para;</a></span></dt>
<dd><p>Toggle or set the <code class="code">&quot;hold&quot;</code> state of the plotting engine which
determines whether new graphic objects are added to the plot or replace
the existing objects.
</p>
<dl class="table">
<dt><code class="code">hold on</code></dt>
<dd><p>Retain plot data and settings so that subsequent plot commands are displayed
on a single graph.  Line color and line style are advanced for each new plot
added.
</p>
</dd>
<dt><code class="code">hold all (deprecated)</code></dt>
<dd><p>Equivalent to <code class="code">hold on</code>.
</p>
</dd>
<dt><code class="code">hold off</code></dt>
<dd><p>Restore default graphics settings which clear the graph and reset axes
properties before each new plot command.  (default).
</p>
</dd>
<dt><code class="code">hold</code></dt>
<dd><p>Toggle the current hold state.
</p></dd>
</dl>

<p>When given the additional argument <var class="var">hax</var>, the hold state is modified
for this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>To query the current hold state use the <code class="code">ishold</code> function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFishold">ishold</a>, <a class="ref" href="#XREFcla">cla</a>, <a class="ref" href="#XREFclf">clf</a>, <a class="ref" href="#XREFnewplot">newplot</a>.
</p></dd></dl>


<a class="anchor" id="XREFishold"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-ishold"><span><code class="def-type"><var class="var">tf</var> =</code> <strong class="def-name">ishold</strong><a class="copiable-link" href="#index-ishold"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ishold-1"><span><code class="def-type"><var class="var">tf</var> =</code> <strong class="def-name">ishold</strong> <code class="def-code-arguments">(<var class="var">hax</var>)</code><a class="copiable-link" href="#index-ishold-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ishold-2"><span><code class="def-type"><var class="var">tf</var> =</code> <strong class="def-name">ishold</strong> <code class="def-code-arguments">(<var class="var">hfig</var>)</code><a class="copiable-link" href="#index-ishold-2"> &para;</a></span></dt>
<dd><p>Return true if the next plot will be added to the current plot, or
false if the plot device will be cleared before drawing the next plot.
</p>
<p>If the first argument is an axes handle <var class="var">hax</var> or figure handle
<var class="var">hfig</var> then operate on this plot rather than the current one.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFhold">hold</a>, <a class="ref" href="#XREFnewplot">newplot</a>.
</p></dd></dl>

<p>To clear the current figure, call the <code class="code">clf</code> function.  To clear the
current axis, call the <code class="code">cla</code> function.  To bring the current figure
to the top of the window stack, call the <code class="code">shg</code> function.  To delete
a graphics object, call <code class="code">delete</code> on its index.  To close the
figure window, call the <code class="code">close</code> function.
</p>
<a class="anchor" id="XREFclf"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-clf"><span><strong class="def-name">clf</strong><a class="copiable-link" href="#index-clf"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clf-1"><span><strong class="def-name">clf</strong> <code class="def-code-arguments">reset</code><a class="copiable-link" href="#index-clf-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clf-2"><span><strong class="def-name">clf</strong> <code class="def-code-arguments">(<var class="var">hfig</var>)</code><a class="copiable-link" href="#index-clf-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clf-3"><span><strong class="def-name">clf</strong> <code class="def-code-arguments">(<var class="var">hfig</var>, &quot;reset&quot;)</code><a class="copiable-link" href="#index-clf-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clf-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">clf</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-clf-4"> &para;</a></span></dt>
<dd><p>Clear the current figure window.
</p>
<p><code class="code">clf</code> operates by deleting child graphics objects with visible
handles (HandleVisibility = <code class="code">&quot;on&quot;</code>).
</p>
<p>If the optional argument <code class="code">&quot;reset&quot;</code> is specified, delete all child
objects including those with hidden handles and reset all figure
properties to their defaults.  However, the following properties are not
reset: Position, Units, PaperPosition, PaperUnits.
</p>
<p>If the first argument <var class="var">hfig</var> is a figure handle, then operate on
this figure rather than the current figure returned by <code class="code">gcf</code>.
</p>
<p>The optional return value <var class="var">h</var> is the graphics handle of the figure
window that was cleared.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFcla">cla</a>, <a class="ref" href="#XREFclose">close</a>, <a class="ref" href="#XREFdelete">delete</a>, <a class="ref" href="Managing-Default-Properties.html#XREFreset">reset</a>.
</p></dd></dl>


<a class="anchor" id="XREFcla"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-cla"><span><strong class="def-name">cla</strong><a class="copiable-link" href="#index-cla"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-cla-1"><span><strong class="def-name">cla</strong> <code class="def-code-arguments">reset</code><a class="copiable-link" href="#index-cla-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-cla-2"><span><strong class="def-name">cla</strong> <code class="def-code-arguments">(<var class="var">hax</var>)</code><a class="copiable-link" href="#index-cla-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-cla-3"><span><strong class="def-name">cla</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &quot;reset&quot;)</code><a class="copiable-link" href="#index-cla-3"> &para;</a></span></dt>
<dd><p>Clear the current or specified (<var class="var">hax</var>) axes object.
</p>
<p><code class="code">cla</code> operates by deleting child graphic objects with visible
handles (<code class="code">HandleVisibility</code> = <code class="code">&quot;on&quot;</code>).  This typically clears the
axes of any visual objects, but leaves in place axes limits, tick marks and
labels, camera view, etc.  In addition, the automatic coloring and styling
of lines is reset by changing the axes properties <code class="code">ColorOrderIndex</code>,
<code class="code">LinestyleOrderIndex</code> to 1.
</p>
<p>If the optional argument <code class="code">&quot;reset&quot;</code> is specified, delete all child
objects, including those with hidden handles, and reset all axes properties
to their defaults.  However, the following properties are not reset:
<code class="code">Position</code>, <code class="code">Units</code>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFclf">clf</a>, <a class="ref" href="#XREFdelete">delete</a>, <a class="ref" href="Managing-Default-Properties.html#XREFreset">reset</a>.
</p></dd></dl>


<a class="anchor" id="XREFshg"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-shg"><span><strong class="def-name">shg</strong><a class="copiable-link" href="#index-shg"> &para;</a></span></dt>
<dd><p>Show the graph window.
</p>
<p>This function makes the current figure visible, and places it on top of
of all other plot windows.
</p>
<p>Programming Note: <code class="code">shg</code> is equivalent to <code class="code">figure (gcf)</code> assuming
that a current figure exists.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a class="ref" href="#XREFdrawnow">drawnow</a>, <a class="ref" href="Handle-Functions.html#XREFgcf">gcf</a>.
</p></dd></dl>


<a class="anchor" id="XREFdelete"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-delete"><span><strong class="def-name">delete</strong> <code class="def-code-arguments"><var class="var">file</var></code><a class="copiable-link" href="#index-delete"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-delete-1"><span><strong class="def-name">delete</strong> <code class="def-code-arguments"><var class="var">file1</var> <var class="var">file2</var> &hellip;</code><a class="copiable-link" href="#index-delete-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-delete-2"><span><strong class="def-name">delete</strong> <code class="def-code-arguments">(<var class="var">file</var>)</code><a class="copiable-link" href="#index-delete-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-delete-3"><span><strong class="def-name">delete</strong> <code class="def-code-arguments">(<var class="var">file1</var>, <var class="var">file2</var>, &hellip;)</code><a class="copiable-link" href="#index-delete-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-delete-4"><span><strong class="def-name">delete</strong> <code class="def-code-arguments">(<var class="var">handle</var>)</code><a class="copiable-link" href="#index-delete-4"> &para;</a></span></dt>
<dd><p>Delete the named file or graphics handle.
</p>
<p><var class="var">file</var> may contain globbing patterns such as &lsquo;<samp class="samp">*</samp>&rsquo;.  Multiple files
to be deleted may be specified in the same function call.
</p>
<p><var class="var">handle</var> may be a scalar or vector of graphic handles to delete.
</p>
<p>Programming Note: Deleting graphics objects is the proper way to remove
features from a plot without clearing the entire figure.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFclf">clf</a>, <a class="ref" href="#XREFcla">cla</a>, <a class="ref" href="Filesystem-Utilities.html#XREFunlink">unlink</a>, <a class="ref" href="Filesystem-Utilities.html#XREFrmdir">rmdir</a>.
</p></dd></dl>


<a class="anchor" id="XREFclose"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-close"><span><strong class="def-name">close</strong><a class="copiable-link" href="#index-close"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-1"><span><strong class="def-name">close</strong> <code class="def-code-arguments">(<var class="var">h</var>)</code><a class="copiable-link" href="#index-close-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-2"><span><strong class="def-name">close</strong> <code class="def-code-arguments"><var class="var">figname</var></code><a class="copiable-link" href="#index-close-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-3"><span><strong class="def-name">close</strong> <code class="def-code-arguments">all</code><a class="copiable-link" href="#index-close-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-4"><span><strong class="def-name">close</strong> <code class="def-code-arguments">all hidden</code><a class="copiable-link" href="#index-close-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-5"><span><strong class="def-name">close</strong> <code class="def-code-arguments">all force</code><a class="copiable-link" href="#index-close-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-close-6"><span><code class="def-type"><var class="var">status</var> =</code> <strong class="def-name">close</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-close-6"> &para;</a></span></dt>
<dd><p>Close figure window(s).
</p>
<p>When called with no arguments, close the current figure.  This is equivalent
to <code class="code">close (gcf)</code>.  If the input <var class="var">h</var> is a graphic handle, or vector
of graphics handles, then close each figure in <var class="var">h</var>.  The figure to
close may also be specified by name <var class="var">figname</var> which is matched against
the <code class="code">&quot;Name&quot;</code> property of all figures.
</p>
<p>If the argument <code class="code">&quot;all&quot;</code> is given then all figures with visible handles
(HandleVisibility = <code class="code">&quot;on&quot;</code>) are closed.
</p>
<p>If the additional argument <code class="code">&quot;hidden&quot;</code> is given then all figures,
including hidden ones, are closed.
</p>
<p>If the additional argument <code class="code">&quot;force&quot;</code> is given then figures are closed
even when <code class="code">&quot;closerequestfcn&quot;</code> has been altered to prevent closing the
window.
</p>
<p>If the optional output <var class="var">status</var> is requested then Octave returns 1 if
the figure windows were closed successfully.
</p>
<p>Implementation Note: <code class="code">close</code> operates by making the handle <var class="var">h</var> the
current figure, and then calling the function specified by the
<code class="code">&quot;closerequestfcn&quot;</code> property of the figure.  By default, the function
<code class="code">closereq</code> is used.  It is possible that the function invoked will
delay or abort removing the figure.  To remove a figure without executing
any callback functions use <code class="code">delete</code>.  When writing a callback function
to close a window do not use <code class="code">close</code> to avoid recursion.
</p>

<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFclosereq">closereq</a>, <a class="ref" href="#XREFdelete">delete</a>.
</p></dd></dl>


<a class="anchor" id="XREFclosereq"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-closereq"><span><strong class="def-name">closereq</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-closereq"> &para;</a></span></dt>
<dd><p>Close the current figure and delete all graphics objects associated with it.
</p>
<p>By default, the <code class="code">&quot;closerequestfcn&quot;</code> property of a new plot figure
points to this function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFclose">close</a>, <a class="ref" href="#XREFdelete">delete</a>.
</p></dd></dl>


</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Use-of-the-_0022interpreter_0022-Property.html">Use of the &quot;interpreter&quot; Property</a>, Previous: <a href="Manipulation-of-Plot-Objects.html">Manipulation of Plot Objects</a>, Up: <a href="High_002dLevel-Plotting.html">High-Level Plotting</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>