Next: Use of the <code>interpreter</code> Property, Previous: Use of axis, line, and patch Functions, Up: High-Level Plotting
By default, Octave refreshes the plot window when a prompt is printed,
or when waiting for input. The
drawnow function is used to cause a plot window to be updated.
Update figure windows and their children. The event queue is flushed and any callbacks generated are executed. With the optional argument
"expose", only graphic objects are updated and no other events or callbacks are processed. The third calling form ofdrawnowis for debugging and is undocumented.
Only figures that are modified will be updated. The refresh
function can also be used to force an update of the current figure, even if
it is not modified.
Refresh a figure, forcing it to be redrawn. When called without an argument the current figure is redrawn. Otherwise, the figure pointed to by h is redrawn.
See also: drawnow.
Normally, high-level plot functions like plot or mesh call
newplot 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 hold
function. For example,
hold on;
x = -10:0.1:10;
plot (x, sin (x));
plot (x, cos (x));
hold off;
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.
Prepare graphics engine to produce a new plot. This function is called at the beginning of all high-level plotting functions. It is not normally required in user programs.
The optional return value h is a graphics handle to the created axes (not figure).
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.
hold on- Retain plot data and settings so that subsequent plot commands are displayed on a single graph.
hold all- Retain plot line color, line style, data and settings so that subsequent plot commands are displayed on a single graph with the next line color and style.
hold off- Clear plot and restore default graphics settings before each new plot command. (default).
hold- Toggle the current hold state.
When given the additional argument hax, the hold state is modified only for the given axis handle.
To query the current hold state use the
isholdfunction.
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.
Optionally, operate on the graphics handle h rather than the current plot.
See also: hold.
To clear the current figure, call the clf function. To clear the
current axis, call the cla function. To bring the current figure
to the top of the window stack, call the shg function. To delete
a graphics object, call delete on its index. To close the
figure window, call the close function.
Clear the current figure window.
clfoperates by deleting child graphics objects with visible handles (handlevisibility= on). If hfig is specified operate on it instead of the current figure. If the optional argument"reset"is specified, all objects including those with hidden handles are deleted.The optional return value h is the graphics handle of the figure window that was cleared.
Delete the children of the current axes with visible handles. If hax is specified and is an axes object handle, operate on it instead of the current axes. If the optional argument
"reset"is specified, also delete the children with hidden handles.See also: clf.
Delete the named file or graphics handle.
Deleting graphics objects is the proper way to remove features from a plot without clearing the entire figure.
Close figure window(s) by calling the function specified by the
"closerequestfcn"property for each figure. By default, the functionclosereqis used.See also: closereq.