Graphics |
High-Level Versus Low-Level
Many MATLAB graphics functions call the object creation functions to draw graphics objects. However, high-level routines also clear the axes or create a new figure, depending on the settings of the axes and figure NextPlot
properties.
In contrast, core object creation functions simply create their respective graphics objects and place them in the current parent object. They do not respect the settings of the figure or axes NextPlot
property.
For example, if you call the line
function,
MATLAB draws a red line in the current axes using the specified data values. If there is no axes, MATLAB creates one. If there is no figure window in which to create the axes, MATLAB creates it as well.
If you call the line
function a second time, MATLAB draws the second line in the current axes without erasing the first line. This behavior is different from high-level functions like plot
that delete graphics objects and reset all axes properties (except Position
and Units
). You can change the behavior of high-level functions by using the hold
command or by changing the setting of the axes NextPlot
property.
See Controlling Graphics Output for more information on this behavior and on using the NextPlot
property.
Parenting | Simplified Calling Syntax |
© 1994-2005 The MathWorks, Inc.