MATLAB Functions Help Desk

newplot

Purpose

Determine where to draw graphics objects

Syntax

Description

newplot is used at the beginning of high-level graphics M-files to determine in which Figure and Axes to draw subsequent graphics objects. Calling newplot can change the current Figure and current Axes.

newplot prepares a Figure and Axes for subsequent graphics commands.

h = newplot prepares a Figure and Axes for subsequent graphics commands and returns a handle to the current Axes.

Algorithm

First, newplot reads the current Figure's NextPlot property and acts accordingly:

NextPlot

Description

add

Draw to the current Figure without clearing any graphics objects already present.

replacechildren

Remove all child objects, but do not reset Figure properties to their defaults. This clears the current Figure like the clf command.

replace

Remove all child objects and reset Figure properties to their defaults. This clears and resets the current Figure like the clf reset command.

After newplot establishes which Figure to draw in, it reads the current Axes' NextPlot property and acts accordingly:

NextPlot

Description

add

Draw to the current Axes, retaining all graphics objects already present.

replacechildren

Remove all child objects, but do not reset Axes properties. This clears the current Axes like the cla command.

replace

Removes all child objects and resets Axes properties to their defaults. This clears and resets the current Axes like the cla reset command.

See Also

axes, cla, clf, figure, hold, ishold

The NextPlot property for Figure and Axes graphics objects.



[ Previous | Help Desk | Next ]