Navigation

Operators and Keywords

Function List:

C++ API

: newplot ()
: newplot (hfig)
: newplot (hax)
: hax = newplot (…)

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. newplot queries the "NextPlot" field of the current figure and axis to determine what to do.

Figure NextPlotAction
"new"Create a new figure and make it the current figure.
"add" (default)Add new graphic objects to the current figure.
"replacechildren"Delete child objects whose HandleVisibility is set to "on". Set NextPlot property to "add". This typically clears a figure, but leaves in place hidden objects such as menubars. This is equivalent to clf.
"replace"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 clf reset.
Axis NextPlotAction
"add"Add new graphic objects to the current axes. This is equivalent to hold on.
"replacechildren"Delete child objects whose HandleVisibility is set to "on", but leave axis properties unmodified. This typically clears a plot, but preserves special settings such as log scaling for axes. This is equivalent to cla.
"replace" (default)Delete all child objects of the axis and reset all axis properties to their defaults. However, the following properties are not reset: Position, Units. This is equivalent to cla reset.

If the optional input hfig or hax is given then prepare the specified figure or axes rather than the current figure and axes.

The optional return value hax is a graphics handle to the created axes object (not figure).

Caution: Calling newplot may change the current figure and current axis.

Package: octave