File: Graphics-Objects.html

package info (click to toggle)
octave3.2 3.2.4-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 62,936 kB
  • ctags: 37,353
  • sloc: cpp: 219,497; fortran: 116,336; ansic: 10,264; sh: 5,508; makefile: 4,245; lex: 3,573; yacc: 3,062; objc: 2,042; lisp: 1,692; awk: 860; perl: 844
file content (550 lines) | stat: -rw-r--r-- 27,680 bytes parent folder | download
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<html lang="en">
<head>
<title>Graphics Objects - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Advanced-Plotting.html#Advanced-Plotting" title="Advanced Plotting">
<link rel="next" href="Graphics-Object-Properties.html#Graphics-Object-Properties" title="Graphics Object Properties">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Graphics-Objects"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Graphics-Object-Properties.html#Graphics-Object-Properties">Graphics Object Properties</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Advanced-Plotting.html#Advanced-Plotting">Advanced Plotting</a>
<hr>
</div>

<h4 class="subsection">15.2.1 Graphics Objects</h4>

<p>Plots in Octave are constructed from the following <dfn>graphics
objects</dfn>.  Each graphics object has a set of properties that define its
appearance and may also contain links to other graphics objects. 
Graphics objects are only referenced by a numeric index, or <dfn>handle</dfn>.

     <dl>
<dt>root figure<dd><a name="index-root-figure-graphics-object-1110"></a><a name="index-graphics-object_002c-root-figure-1111"></a>The parent of all figure objects.  The index for the root figure is
defined to be 0.

     <br><dt>figure<dd><a name="index-figure-graphics-object-1112"></a><a name="index-graphics-object_002c-figure-1113"></a>A figure window.

     <br><dt>axes<dd><a name="index-axes-graphics-object-1114"></a><a name="index-graphics-object_002c-axes-1115"></a>A set of axes.  This object is a child of a figure object and may be a
parent of line, text, image, patch, or surface objects.

     <br><dt>line<dd><a name="index-line-graphics-object-1116"></a><a name="index-graphics-object_002c-line-1117"></a>A line in two or three dimensions.

     <br><dt>text<dd><a name="index-text-graphics-object-1118"></a><a name="index-graphics-object_002c-text-1119"></a>Text annotations.

     <br><dt>image<dd><a name="index-image-graphics-object-1120"></a><a name="index-graphics-object_002c-image-1121"></a>A bitmap image.

     <br><dt>patch<dd><a name="index-patch-graphics-object-1122"></a><a name="index-graphics-object_002c-patch-1123"></a>A filled polygon, currently limited to two dimensions.

     <br><dt>surface<dd><a name="index-surface-graphics-object-1124"></a><a name="index-graphics-object_002c-surface-1125"></a>A three-dimensional surface. 
</dl>

   <p>To determine whether a variable is a graphics object index or a figure
index, use the functions <code>ishandle</code> and <code>isfigure</code>.

<!-- graphics.cc -->
   <p><a name="doc_002dishandle"></a>

<div class="defun">
&mdash; Built-in Function:  <b>ishandle</b> (<var>h</var>)<var><a name="index-ishandle-1126"></a></var><br>
<blockquote><p>Return true if <var>h</var> is a graphics handle and false otherwise. 
</p></blockquote></div>

<!-- ./plot/ishghandle.m -->
   <p><a name="doc_002dishghandle"></a>

<div class="defun">
&mdash; Function File:  <b>ishghandle</b> (<var>h</var>)<var><a name="index-ishghandle-1127"></a></var><br>
<blockquote><p>Return true if <var>h</var> is a graphics handle and false otherwise. 
</p></blockquote></div>

<!-- ./plot/isfigure.m -->
   <p><a name="doc_002disfigure"></a>

<div class="defun">
&mdash; Function File:  <b>isfigure</b> (<var>h</var>)<var><a name="index-isfigure-1128"></a></var><br>
<blockquote><p>Return true if <var>h</var> is a graphics handle that contains a figure
object and false otherwise. 
</p></blockquote></div>

   <p>The function <code>gcf</code> returns an index to the current figure object,
or creates one if none exists.  Similarly, <code>gca</code> returns the
current axes object, or creates one (and its parent figure object) if
none exists.

<!-- ./plot/gcf.m -->
   <p><a name="doc_002dgcf"></a>

<div class="defun">
&mdash; Function File:  <b>gcf</b> ()<var><a name="index-gcf-1129"></a></var><br>
<blockquote><p>Return the current figure handle.  If a figure does not exist, create
one and return its handle.  The handle may then be used to examine or
set properties of the figure.  For example,

     <pre class="example">          fplot (@sin, [-10, 10]);
          fig = gcf ();
          set (fig, "visible", "off");
</pre>
        <p class="noindent">plots a sine wave, finds the handle of the current figure, and then
makes that figure invisible.  Setting the visible property of the
figure to <code>"on"</code> will cause it to be displayed again. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dget.html#doc_002dget">get</a>, <a href="doc_002dset.html#doc_002dset">set</a>. 
</p></blockquote></div>

<!-- ./plot/gca.m -->
   <p><a name="doc_002dgca"></a>

<div class="defun">
&mdash; Function File:  <b>gca</b> ()<var><a name="index-gca-1130"></a></var><br>
<blockquote><p>Return a handle to the current axis object.  If no axis object
exists, create one and return its handle.  The handle may then be
used to examine or set properties of the axes.  For example,

     <pre class="example">          ax = gca ();
          set (ax, "position", [0.5, 0.5, 0.5, 0.5]);
</pre>
        <p class="noindent">creates an empty axes object, then changes its location and size in
the figure window. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dget.html#doc_002dget">get</a>, <a href="doc_002dset.html#doc_002dset">set</a>. 
</p></blockquote></div>

   <p>The <code>get</code> and <code>set</code> functions may be used to examine and set
properties for graphics objects.  For example,

<pre class="example">     get (0)
          ans =
            {
              type = root
              currentfigure = [](0x0)
              children = [](0x0)
              visible = on
     			...
            }
</pre>
   <p class="noindent">returns a structure containing all the properties of the root figure. 
As with all functions in Octave, the structure is returned by value, so
modifying it will not modify the internal root figure plot object.  To
do that, you must use the <code>set</code> function.  Also, note that in this
case, the <code>currentfigure</code> property is empty, which indicates that
there is no current figure window.

   <p>The <code>get</code> function may also be used to find the value of a single
property.  For example,

<pre class="example">     get (gca (), "xlim")
          [ 0 1 ]
</pre>
   <p class="noindent">returns the range of the x-axis for the current axes object in the
current figure.

   <p>To set graphics object properties, use the set function.  For example,

<pre class="example">     set (gca (), "xlim", [-10, 10]);
</pre>
   <p class="noindent">sets the range of the x-axis for the current axes object in the current
figure to &lsquo;<samp><span class="samp">[-10, 10]</span></samp>&rsquo;.  Additionally, calling set with a graphics
object index as the only argument returns a structure containing the
default values for all the properties for the given object type.  For
example,

<pre class="example">     set (gca ())
</pre>
   <p class="noindent">returns a structure containing the default property values for axes
objects.

<!-- graphics.cc -->
   <p><a name="doc_002dget"></a>

<div class="defun">
&mdash; Built-in Function:  <b>get</b> (<var>h, p</var>)<var><a name="index-get-1131"></a></var><br>
<blockquote><p>Return the named property <var>p</var> from the graphics handle <var>h</var>. 
If <var>p</var> is omitted, return the complete property list for <var>h</var>. 
If <var>h</var> is a vector, return a cell array including the property
values or lists respectively. 
</p></blockquote></div>

<!-- graphics.cc -->
   <p><a name="doc_002dset"></a>

<div class="defun">
&mdash; Built-in Function:  <b>set</b> (<var>h, p, v, <small class="dots">...</small></var>)<var><a name="index-set-1132"></a></var><br>
<blockquote><p>Set the named property value or vector <var>p</var> to the value <var>v</var>
for the graphics handle <var>h</var>. 
</p></blockquote></div>

<!-- ./plot/ancestor.m -->
   <p><a name="doc_002dancestor"></a>

<div class="defun">
&mdash; Function File: <var>parent</var> = <b>ancestor</b> (<var>h, type</var>)<var><a name="index-ancestor-1133"></a></var><br>
&mdash; Function File: <var>parent</var> = <b>ancestor</b> (<var>h, type, 'toplevel'</var>)<var><a name="index-ancestor-1134"></a></var><br>
<blockquote><p>Return the first ancestor of handle object <var>h</var> whose type matches
<var>type</var>, where <var>type</var> is a character string.  If <var>type</var> is a
cell array of strings, return the first parent whose type matches
any of the given type strings.

        <p>If the handle object <var>h</var> is of type <var>type</var>, return <var>h</var>.

        <p>If <code>"toplevel"</code> is given as a 3rd argument, return the highest
parent in the object hierarchy that matches the condition, instead
of the first (nearest) one. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dget.html#doc_002dget">get</a>, <a href="doc_002dset.html#doc_002dset">set</a>. 
</p></blockquote></div>

<!-- ./plot/allchild.m -->
   <p><a name="doc_002dallchild"></a>

<div class="defun">
&mdash; Function File: <var>h</var> = <b>allchild</b> (<var>handles</var>)<var><a name="index-allchild-1135"></a></var><br>
<blockquote><p>Find all children, including hidden children, of a graphics object.

        <p>This function is similar to <code>get (h, "children")</code>, but also
returns includes hidden objects.  If <var>handles</var> is a scalar,
<var>h</var> will be a vector.  Otherwise, <var>h</var> will be a cell matrix
of the same size as <var>handles</var> and each cell will contain a
vector of handles. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dget.html#doc_002dget">get</a>, <a href="doc_002dset.html#doc_002dset">set</a>, <a href="doc_002dfindall.html#doc_002dfindall">findall</a>, <a href="doc_002dfindobj.html#doc_002dfindobj">findobj</a>. 
</p></blockquote></div>

   <p>You can create axes, line, and patch objects directly using the
<code>axes</code>, <code>line</code>, and <code>patch</code> functions.  These objects
become children of the current axes object.

<!-- ./plot/axes.m -->
   <p><a name="doc_002daxes"></a>

<div class="defun">
&mdash; Function File:  <b>axes</b> ()<var><a name="index-axes-1136"></a></var><br>
&mdash; Function File:  <b>axes</b> (<var>property, value, <small class="dots">...</small></var>)<var><a name="index-axes-1137"></a></var><br>
&mdash; Function File:  <b>axes</b> (<var>h</var>)<var><a name="index-axes-1138"></a></var><br>
<blockquote><p>Create an axes object and return a handle to it. 
</p></blockquote></div>

<!-- ./plot/line.m -->
   <p><a name="doc_002dline"></a>

<div class="defun">
&mdash; Function File:  <b>line</b> ()<var><a name="index-line-1139"></a></var><br>
&mdash; Function File:  <b>line</b> (<var>x, y</var>)<var><a name="index-line-1140"></a></var><br>
&mdash; Function File:  <b>line</b> (<var>x, y, z</var>)<var><a name="index-line-1141"></a></var><br>
&mdash; Function File:  <b>line</b> (<var>x, y, z, property, value, <small class="dots">...</small></var>)<var><a name="index-line-1142"></a></var><br>
<blockquote><p>Create line object from <var>x</var> and <var>y</var> and insert in current
axes object.  Return a handle (or vector of handles) to the line
objects created.

        <p>Multiple property-value pairs may be specified for the line, but they
must appear in pairs. 
</p></blockquote></div>

<!-- ./plot/patch.m -->
   <p><a name="doc_002dpatch"></a>

<div class="defun">
&mdash; Function File:  <b>patch</b> ()<var><a name="index-patch-1143"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var>x, y, c</var>)<var><a name="index-patch-1144"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var>x, y, z, c</var>)<var><a name="index-patch-1145"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var>fv</var>)<var><a name="index-patch-1146"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var>'Faces', f, 'Vertices', v, <small class="dots">...</small></var>)<var><a name="index-patch-1147"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var><small class="dots">...</small>, prop, val</var>)<var><a name="index-patch-1148"></a></var><br>
&mdash; Function File:  <b>patch</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-patch-1149"></a></var><br>
&mdash; Function File: <var>h</var> = <b>patch</b> (<var><small class="dots">...</small></var>)<var><a name="index-patch-1150"></a></var><br>
<blockquote><p>Create patch object from <var>x</var> and <var>y</var> with color <var>c</var> and
insert in the current axes object.  Return handle to patch object.

        <p>For a uniform colored patch, <var>c</var> can be given as an RGB vector,
scalar value referring to the current colormap, or string value (for
example, "r" or "red").

        <p>If passed a structure <var>fv</var> contain the fields "vertices", "faces"
and optionally "facevertexcdata", create the patch based on these
properties. 
</p></blockquote></div>

<!-- ./plot/fill.m -->
   <p><a name="doc_002dfill"></a>

<div class="defun">
&mdash; Function File:  <b>fill</b> (<var>x, y, c</var>)<var><a name="index-fill-1151"></a></var><br>
&mdash; Function File:  <b>fill</b> (<var>x1, y1, c1, x2, y2, c2</var>)<var><a name="index-fill-1152"></a></var><br>
&mdash; Function File:  <b>fill</b> (<var><small class="dots">...</small>, prop, val</var>)<var><a name="index-fill-1153"></a></var><br>
&mdash; Function File:  <b>fill</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-fill-1154"></a></var><br>
&mdash; Function File: <var>h</var> = <b>fill</b> (<var><small class="dots">...</small></var>)<var><a name="index-fill-1155"></a></var><br>
<blockquote><p>Create one or more filled patch objects, returning a patch object for each. 
</p></blockquote></div>

<!-- ./plot/surface.m -->
   <p><a name="doc_002dsurface"></a>

<div class="defun">
&mdash; Function File:  <b>surface</b> (<var>x, y, z, c</var>)<var><a name="index-surface-1156"></a></var><br>
&mdash; Function File:  <b>surface</b> (<var>x, y, z</var>)<var><a name="index-surface-1157"></a></var><br>
&mdash; Function File:  <b>surface</b> (<var>z, c</var>)<var><a name="index-surface-1158"></a></var><br>
&mdash; Function File:  <b>surface</b> (<var>z</var>)<var><a name="index-surface-1159"></a></var><br>
&mdash; Function File:  <b>surface</b> (<var><small class="dots">...</small>, prop, val</var>)<var><a name="index-surface-1160"></a></var><br>
&mdash; Function File:  <b>surface</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-surface-1161"></a></var><br>
&mdash; Function File: <var>h</var> = <b>surface</b> (<var><small class="dots">...</small></var>)<var><a name="index-surface-1162"></a></var><br>
<blockquote><p>Plot a surface graphic object given matrices <var>x</var>, and <var>y</var> from
<code>meshgrid</code> and a matrix <var>z</var> corresponding to the <var>x</var> and
<var>y</var> coordinates of the surface.  If <var>x</var> and <var>y</var> are vectors,
then a typical vertex is (<var>x</var>(j), <var>y</var>(i), <var>z</var>(i,j)).  Thus,
columns of <var>z</var> correspond to different <var>x</var> values and rows of
<var>z</var> correspond to different <var>y</var> values.  If <var>x</var> and <var>y</var>
are missing, they are constructed from size of the matrix <var>z</var>.

        <p>Any additional properties passed are assigned to the surface. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dsurf.html#doc_002dsurf">surf</a>, <a href="doc_002dmesh.html#doc_002dmesh">mesh</a>, <a href="doc_002dpatch.html#doc_002dpatch">patch</a>, <a href="doc_002dline.html#doc_002dline">line</a>. 
</p></blockquote></div>

   <p>By default, Octave refreshes the plot window when a prompt is printed,
or when waiting for input.  To force an update at other times, call the
<code>drawnow</code> function.

<!-- graphics.cc -->
   <p><a name="doc_002ddrawnow"></a>

<div class="defun">
&mdash; Built-in Function:  <b>drawnow</b> ()<var><a name="index-drawnow-1163"></a></var><br>
&mdash; Built-in Function:  <b>drawnow</b> (<var>"expose"</var>)<var><a name="index-drawnow-1164"></a></var><br>
&mdash; Built-in Function:  <b>drawnow</b> (<var>term, file, mono, debug_file</var>)<var><a name="index-drawnow-1165"></a></var><br>
<blockquote><p>Update figure windows and their children.  The event queue is flushed and
any callbacks generated are executed.  With the optional argument
<code>"expose"</code>, only graphic objects are updated and no other events or
callbacks are processed. 
The third calling form of <code>drawnow</code> is for debugging and is
undocumented. 
</p></blockquote></div>

   <p>Only figures that are modified will be updated.  The <code>refresh</code>
function can also be used to force an update of the current figure, even if
it is not modified.

<!-- ./plot/refresh.m -->
   <p><a name="doc_002drefresh"></a>

<div class="defun">
&mdash; Function File:  <b>refresh</b> ()<var><a name="index-refresh-1166"></a></var><br>
&mdash; Function File:  <b>refresh</b> (<var>h</var>)<var><a name="index-refresh-1167"></a></var><br>
<blockquote><p>Refresh a figure, forcing it to be redrawn.  Called without an
argument the current figure is redrawn, otherwise the figure pointed
to by <var>h</var> is redrawn. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002ddrawnow.html#doc_002ddrawnow">drawnow</a>. 
</p></blockquote></div>

   <p>Normally, high-level plot functions like <code>plot</code> or <code>mesh</code> call
<code>newplot</code> to initialize the state of the current axes so that the
next plot is drawn in a blank window with default property settings.  To
have two plots superimposed over one another, use the <code>hold</code>
function.  For example,

<pre class="example">     hold on;
     x = -10:0.1:10;
     plot (x, sin (x));
     plot (x, cos (x));
     hold off;
</pre>
   <p class="noindent">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.

<!-- ./plot/newplot.m -->
   <p><a name="doc_002dnewplot"></a>

<div class="defun">
&mdash; Function File:  <b>newplot</b> ()<var><a name="index-newplot-1168"></a></var><br>
<blockquote><p>Prepare graphics engine to produce a new plot.  This function should
be called at the beginning of all high-level plotting functions. 
</p></blockquote></div>

<!-- ./plot/hold.m -->
   <p><a name="doc_002dhold"></a>

<div class="defun">
&mdash; Function File:  <b>hold</b><var><a name="index-hold-1169"></a></var><br>
&mdash; Function File:  <b>hold</b><var> state<a name="index-hold-1170"></a></var><br>
&mdash; Function File:  <b>hold</b> (<var>hax, <small class="dots">...</small></var>)<var><a name="index-hold-1171"></a></var><br>
<blockquote><p>Toggle or set the 'hold' state of the plotting engine which determines
whether new graphic objects are added to the plot or replace the existing
objects.

          <dl>
<dt><code>hold on</code><dd>Retain plot data and settings so that subsequent plot commands are displayed
on a single graph.

          <br><dt><code>hold off</code><dd>Clear plot and restore default graphics settings before each new plot
command.  (default).

          <br><dt><code>hold</code><dd>Toggle the current 'hold' state. 
</dl>

        <p>When given the additional argument <var>hax</var>, the hold state is modified
only for the given axis handle.

        <p>To query the current 'hold' state use the <code>ishold</code> function. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dishold.html#doc_002dishold">ishold</a>, <a href="doc_002dcla.html#doc_002dcla">cla</a>, <a href="doc_002dnewplot.html#doc_002dnewplot">newplot</a>, <a href="doc_002dclf.html#doc_002dclf">clf</a>. 
</p></blockquote></div>

<!-- ./plot/ishold.m -->
   <p><a name="doc_002dishold"></a>

<div class="defun">
&mdash; Function File:  <b>ishold</b><var><a name="index-ishold-1172"></a></var><br>
<blockquote><p>Return true if the next line will be added to the current plot, or
false if the plot device will be cleared before drawing the next line. 
</p></blockquote></div>

   <p>To clear the current figure, call the <code>clf</code> function.  To clear the
current axis, call the <code>cla</code> function.  To bring the current figure
to the top of the window stack, call the <code>shg</code> function.  To delete
a graphics object, call <code>delete</code> on its index.  To close the
figure window, call the <code>close</code> function.

<!-- ./plot/clf.m -->
   <p><a name="doc_002dclf"></a>

<div class="defun">
&mdash; Function File:  <b>clf</b> ()<var><a name="index-clf-1173"></a></var><br>
&mdash; Function File:  <b>clf</b> (<var>"reset"</var>)<var><a name="index-clf-1174"></a></var><br>
&mdash; Function File:  <b>clf</b> (<var>hfig</var>)<var><a name="index-clf-1175"></a></var><br>
&mdash; Function File:  <b>clf</b> (<var>hfig, "reset"</var>)<var><a name="index-clf-1176"></a></var><br>
<blockquote><p>Clear the current figure window.  <code>clf</code> operates by deleting child
graphics objects with visible handles (<code>HandleVisibility</code> = on). 
If <var>hfig</var> is specified operate on it instead of the current figure. 
If the optional argument <code>"reset"</code> is specified, all objects including
those with hidden handles are deleted. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcla.html#doc_002dcla">cla</a>, <a href="doc_002dclose.html#doc_002dclose">close</a>, <a href="doc_002ddelete.html#doc_002ddelete">delete</a>. 
</p></blockquote></div>

<!-- ./plot/cla.m -->
   <p><a name="doc_002dcla"></a>

<div class="defun">
&mdash; Function File:  <b>cla</b> ()<var><a name="index-cla-1177"></a></var><br>
&mdash; Function File:  <b>cla</b> (<var>"reset"</var>)<var><a name="index-cla-1178"></a></var><br>
&mdash; Function File:  <b>cla</b> (<var>hax</var>)<var><a name="index-cla-1179"></a></var><br>
&mdash; Function File:  <b>cla</b> (<var>hax, "reset"</var>)<var><a name="index-cla-1180"></a></var><br>
<blockquote><p>Delete the children of the current axes with visible handles. 
If <var>hax</var> is specified and is an axes object handle, operate on it
instead of the current axes.  If the optional argument <code>"reset"</code>
is specified, also delete the children with hidden handles. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dclf.html#doc_002dclf">clf</a>. 
</p></blockquote></div>

<!-- ./plot/shg.m -->
   <p><a name="doc_002dshg"></a>

<div class="defun">
&mdash; Function File:  <b>shg</b><var><a name="index-shg-1181"></a></var><br>
<blockquote><p>Show the graph window.  Currently, this is the same as executing
<code>drawnow</code>. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002ddrawnow.html#doc_002ddrawnow">drawnow</a>, <a href="doc_002dfigure.html#doc_002dfigure">figure</a>. 
</p></blockquote></div>

<!-- ./miscellaneous/delete.m -->
   <p><a name="doc_002ddelete"></a>

<div class="defun">
&mdash; Function File:  <b>delete</b> (<var>file</var>)<var><a name="index-delete-1182"></a></var><br>
&mdash; Function File:  <b>delete</b> (<var>handle</var>)<var><a name="index-delete-1183"></a></var><br>
<blockquote><p>Delete the named file or graphics handle.

        <p>Deleting graphics objects is the proper way to remove
features from a plot without clearing the entire figure. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dclf.html#doc_002dclf">clf</a>, <a href="doc_002dcla.html#doc_002dcla">cla</a>. 
</p></blockquote></div>

<!-- ./plot/close.m -->
   <p><a name="doc_002dclose"></a>

<div class="defun">
&mdash; Command:  <b>close</b><var><a name="index-close-1184"></a></var><br>
&mdash; Command:  <b>close</b> (<var>n</var>)<var><a name="index-close-1185"></a></var><br>
&mdash; Command:  <b>close</b><var> all<a name="index-close-1186"></a></var><br>
&mdash; Command:  <b>close</b><var> all hidden<a name="index-close-1187"></a></var><br>
<blockquote><p>Close figure window(s) by calling the function specified by the
<code>"closerequestfcn"</code> property for each figure.  By default, the
function <code>closereq</code> is used. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dclosereq.html#doc_002dclosereq">closereq</a>. 
</p></blockquote></div>

<!-- ./plot/closereq.m -->
   <p><a name="doc_002dclosereq"></a>

<div class="defun">
&mdash; Function File:  <b>closereq</b> ()<var><a name="index-closereq-1188"></a></var><br>
<blockquote><p>Close the current figure and delete all graphics objects associated
with it. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dclose.html#doc_002dclose">close</a>, <a href="doc_002ddelete.html#doc_002ddelete">delete</a>. 
</p></blockquote></div>

   </body></html>