/usr/share/doc/octave/octave.html/Manipulation-of-Plot-Windows.html is in octave-doc 4.2.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Manipulation of Plot Windows (GNU Octave)</title>
<meta name="description" content="Manipulation of Plot Windows (GNU Octave)">
<meta name="keywords" content="Manipulation of Plot Windows (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="High_002dLevel-Plotting.html#High_002dLevel-Plotting" rel="up" title="High-Level Plotting">
<link href="Use-of-the-interpreter-Property.html#Use-of-the-interpreter-Property" rel="next" title="Use of the interpreter Property">
<link href="Manipulation-of-Plot-Objects.html#Manipulation-of-Plot-Objects" rel="prev" title="Manipulation of Plot Objects">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<a name="Manipulation-of-Plot-Windows"></a>
<div class="header">
<p>
Next: <a href="Use-of-the-interpreter-Property.html#Use-of-the-interpreter-Property" accesskey="n" rel="next">Use of the <code>interpreter</code> Property</a>, Previous: <a href="Manipulation-of-Plot-Objects.html#Manipulation-of-Plot-Objects" accesskey="p" rel="prev">Manipulation of Plot Objects</a>, Up: <a href="High_002dLevel-Plotting.html#High_002dLevel-Plotting" accesskey="u" rel="up">High-Level Plotting</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Manipulation-of-Plot-Windows-1"></a>
<h4 class="subsection">15.2.7 Manipulation of Plot Windows</h4>
<a name="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>drawnow</code> function is used to cause a plot window to be updated.
</p>
<a name="XREFdrawnow"></a><dl>
<dt><a name="index-drawnow"></a>: <em></em> <strong>drawnow</strong> <em>()</em></dt>
<dt><a name="index-drawnow-1"></a>: <em></em> <strong>drawnow</strong> <em>("expose")</em></dt>
<dt><a name="index-drawnow-2"></a>: <em></em> <strong>drawnow</strong> <em>(<var>term</var>, <var>file</var>, <var>debug_file</var>)</em></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>"expose"</code>, only graphic objects are
updated and no other events or callbacks are processed.
</p>
<p>The third calling form of <code>drawnow</code> is for debugging and is
undocumented.
</p>
<p><strong>See also:</strong> <a href="#XREFrefresh">refresh</a>.
</p></dd></dl>
<p>Only figures that are modified will be updated. The <code>refresh</code>
function can also be used to cause an update of the current figure, even if
it is not modified.
</p>
<a name="XREFrefresh"></a><dl>
<dt><a name="index-refresh"></a>: <em></em> <strong>refresh</strong> <em>()</em></dt>
<dt><a name="index-refresh-1"></a>: <em></em> <strong>refresh</strong> <em>(<var>h</var>)</em></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>h</var> is redrawn.
</p>
<p><strong>See also:</strong> <a href="#XREFdrawnow">drawnow</a>.
</p></dd></dl>
<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,
</p>
<div class="example">
<pre class="example">hold on;
x = -10:0.1:10;
plot (x, sin (x));
plot (x, cos (x));
hold off;
</pre></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 name="XREFnewplot"></a><dl>
<dt><a name="index-newplot"></a>: <em></em> <strong>newplot</strong> <em>()</em></dt>
<dt><a name="index-newplot-1"></a>: <em></em> <strong>newplot</strong> <em>(<var>hfig</var>)</em></dt>
<dt><a name="index-newplot-2"></a>: <em></em> <strong>newplot</strong> <em>(<var>hax</var>)</em></dt>
<dt><a name="index-newplot-3"></a>: <em><var>hax</var> =</em> <strong>newplot</strong> <em>(…)</em></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>newplot</code>
queries the <code>"NextPlot"</code> field of the current figure and axes to
determine what to do.
</p>
<table>
<thead><tr><th width="25%">Figure NextPlot</th><th width="75%">Action</th></tr></thead>
<tr><td width="25%"><code>"new"</code></td><td width="75%">Create a new figure and make it the current figure.</td></tr>
<tr><td width="25%"><code>"add"</code> (default)</td><td width="75%">Add new graphic objects to the current
figure.</td></tr>
<tr><td width="25%"><code>"replacechildren"</code></td><td width="75%">Delete child objects whose
HandleVisibility is set to <code>"on"</code>. Set NextPlot property to
<code>"add"</code>. This typically clears a figure, but leaves in place hidden
objects such as menubars. This is equivalent to <code>clf</code>.</td></tr>
<tr><td width="25%"><code>"replace"</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>clf reset</code>.</td></tr>
</table>
<table>
<thead><tr><th width="25%">Axes NextPlot</th><th width="75%">Action</th></tr></thead>
<tr><td width="25%"><code>"add"</code></td><td width="75%">Add new graphic objects to the current axes. This
is equivalent to <code>hold on</code>.</td></tr>
<tr><td width="25%"><code>"replacechildren"</code></td><td width="75%">Delete child objects whose
HandleVisibility is set to <code>"on"</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>cla</code>.</td></tr>
<tr><td width="25%"><code>"replace"</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>cla reset</code>.</td></tr>
</table>
<p>If the optional input <var>hfig</var> or <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>hax</var> is a graphics handle to the created
axes object (not figure).
</p>
<p><strong>Caution:</strong> Calling <code>newplot</code> may change the current figure and
current axes.
</p></dd></dl>
<a name="XREFhold"></a><dl>
<dt><a name="index-hold"></a>: <em></em> <strong>hold</strong></dt>
<dt><a name="index-hold-1"></a>: <em></em> <strong>hold</strong> <em>on</em></dt>
<dt><a name="index-hold-2"></a>: <em></em> <strong>hold</strong> <em>off</em></dt>
<dt><a name="index-hold-3"></a>: <em></em> <strong>hold</strong> <em>(<var>hax</var>, …)</em></dt>
<dd><p>Toggle or set the <code>"hold"</code> state of the plotting engine which
determines whether new graphic objects are added to the plot or replace
the existing objects.
</p>
<dl compact="compact">
<dt><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>hold all (deprecated)</code></dt>
<dd><p>Equivalent to <code>hold on</code>.
</p>
</dd>
<dt><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>hold</code></dt>
<dd><p>Toggle the current hold state.
</p></dd>
</dl>
<p>When given the additional argument <var>hax</var>, the hold state is modified
for this axes rather than the current axes returned by <code>gca</code>.
</p>
<p>To query the current hold state use the <code>ishold</code> function.
</p>
<p><strong>See also:</strong> <a href="#XREFishold">ishold</a>, <a href="#XREFcla">cla</a>, <a href="#XREFclf">clf</a>, <a href="#XREFnewplot">newplot</a>.
</p></dd></dl>
<a name="XREFishold"></a><dl>
<dt><a name="index-ishold"></a>: <em></em> <strong>ishold</strong></dt>
<dt><a name="index-ishold-1"></a>: <em></em> <strong>ishold</strong> <em>(<var>hax</var>)</em></dt>
<dt><a name="index-ishold-2"></a>: <em></em> <strong>ishold</strong> <em>(<var>hfig</var>)</em></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>hax</var> or figure handle
<var>hfig</var> then operate on this plot rather than the current one.
</p>
<p><strong>See also:</strong> <a href="#XREFhold">hold</a>, <a href="#XREFnewplot">newplot</a>.
</p></dd></dl>
<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.
</p>
<a name="XREFclf"></a><dl>
<dt><a name="index-clf"></a>: <em></em> <strong>clf</strong></dt>
<dt><a name="index-clf-1"></a>: <em></em> <strong>clf</strong> <em>reset</em></dt>
<dt><a name="index-clf-2"></a>: <em></em> <strong>clf</strong> <em>(<var>hfig</var>)</em></dt>
<dt><a name="index-clf-3"></a>: <em></em> <strong>clf</strong> <em>(<var>hfig</var>, "reset")</em></dt>
<dt><a name="index-clf-4"></a>: <em><var>h</var> =</em> <strong>clf</strong> <em>(…)</em></dt>
<dd><p>Clear the current figure window.
</p>
<p><code>clf</code> operates by deleting child graphics objects with visible
handles (HandleVisibility = <code>"on"</code>).
</p>
<p>If the optional argument <code>"reset"</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>hfig</var> is a figure handle, then operate on
this figure rather than the current figure returned by <code>gcf</code>.
</p>
<p>The optional return value <var>h</var> is the graphics handle of the figure
window that was cleared.
</p>
<p><strong>See also:</strong> <a href="#XREFcla">cla</a>, <a href="#XREFclose">close</a>, <a href="#XREFdelete">delete</a>, <a href="Managing-Default-Properties.html#XREFreset">reset</a>.
</p></dd></dl>
<a name="XREFcla"></a><dl>
<dt><a name="index-cla"></a>: <em></em> <strong>cla</strong></dt>
<dt><a name="index-cla-1"></a>: <em></em> <strong>cla</strong> <em>reset</em></dt>
<dt><a name="index-cla-2"></a>: <em></em> <strong>cla</strong> <em>(<var>hax</var>)</em></dt>
<dt><a name="index-cla-3"></a>: <em></em> <strong>cla</strong> <em>(<var>hax</var>, "reset")</em></dt>
<dd><p>Clear the current axes.
</p>
<p><code>cla</code> operates by deleting child graphic objects with visible
handles (HandleVisibility = <code>"on"</code>).
</p>
<p>If the optional argument <code>"reset"</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:
Position, Units.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code>gca</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFclf">clf</a>, <a href="#XREFdelete">delete</a>, <a href="Managing-Default-Properties.html#XREFreset">reset</a>.
</p></dd></dl>
<a name="XREFshg"></a><dl>
<dt><a name="index-shg"></a>: <em></em> <strong>shg</strong></dt>
<dd><p>Show the graph window.
</p>
<p>Currently, this is the same as executing <code>drawnow</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFdrawnow">drawnow</a>, <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>.
</p></dd></dl>
<a name="XREFdelete"></a><dl>
<dt><a name="index-delete"></a>: <em></em> <strong>delete</strong> <em>(<var>file</var>)</em></dt>
<dt><a name="index-delete-1"></a>: <em></em> <strong>delete</strong> <em>(<var>file1</var>, <var>file2</var>, …)</em></dt>
<dt><a name="index-delete-2"></a>: <em></em> <strong>delete</strong> <em>(<var>handle</var>)</em></dt>
<dd><p>Delete the named file or graphics handle.
</p>
<p><var>file</var> may contain globbing patterns such as ‘<samp>*</samp>’. Multiple files
to be deleted may be specified in the same function call.
</p>
<p><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>See also:</strong> <a href="#XREFclf">clf</a>, <a href="#XREFcla">cla</a>, <a href="Filesystem-Utilities.html#XREFunlink">unlink</a>, <a href="Filesystem-Utilities.html#XREFrmdir">rmdir</a>.
</p></dd></dl>
<a name="XREFclose"></a><dl>
<dt><a name="index-close"></a>: <em></em> <strong>close</strong></dt>
<dt><a name="index-close-1"></a>: <em></em> <strong>close</strong> <em><var>h</var></em></dt>
<dt><a name="index-close-2"></a>: <em></em> <strong>close</strong> <em>(<var>h</var>)</em></dt>
<dt><a name="index-close-3"></a>: <em></em> <strong>close</strong> <em>(<var>h</var>, "force")</em></dt>
<dt><a name="index-close-4"></a>: <em></em> <strong>close</strong> <em>all</em></dt>
<dt><a name="index-close-5"></a>: <em></em> <strong>close</strong> <em>all hidden</em></dt>
<dt><a name="index-close-6"></a>: <em></em> <strong>close</strong> <em>all force</em></dt>
<dd><p>Close figure window(s).
</p>
<p>When called with no arguments, close the current figure. This is equivalent
to <code>close (gcf)</code>. If the input <var>h</var> is a graphic handle, or vector
of graphics handles, then close each figure in <var>h</var>.
</p>
<p>If the argument <code>"all"</code> is given then all figures with visible handles
(HandleVisibility = <code>"on"</code>) are closed.
</p>
<p>If the argument <code>"all hidden"</code> is given then all figures, including
hidden ones, are closed.
</p>
<p>If the argument <code>"force"</code> is given then figures are closed even when
<code>"closerequestfcn"</code> has been altered to prevent closing the window.
</p>
<p>Implementation Note: <code>close</code> operates by calling the function specified
by the <code>"closerequestfcn"</code> property for each figure. By default, the
function <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>delete</code>. When writing a callback
function to close a window do not use <code>close</code> to avoid recursion.
</p>
<p><strong>See also:</strong> <a href="#XREFclosereq">closereq</a>, <a href="#XREFdelete">delete</a>.
</p></dd></dl>
<a name="XREFclosereq"></a><dl>
<dt><a name="index-closereq"></a>: <em></em> <strong>closereq</strong> <em>()</em></dt>
<dd><p>Close the current figure and delete all graphics objects associated with it.
</p>
<p>By default, the <code>"closerequestfcn"</code> property of a new plot figure
points to this function.
</p>
<p><strong>See also:</strong> <a href="#XREFclose">close</a>, <a href="#XREFdelete">delete</a>.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Use-of-the-interpreter-Property.html#Use-of-the-interpreter-Property" accesskey="n" rel="next">Use of the <code>interpreter</code> Property</a>, Previous: <a href="Manipulation-of-Plot-Objects.html#Manipulation-of-Plot-Objects" accesskey="p" rel="prev">Manipulation of Plot Objects</a>, Up: <a href="High_002dLevel-Plotting.html#High_002dLevel-Plotting" accesskey="u" rel="up">High-Level Plotting</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|