Graphics    

High-Level Versus Low-Level

The MATLAB high-level graphics routines (e.g., plot or surf) call the appropriate object creation function 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, object creation functions simply create their respective graphics objects and place them in the current parent object. They do not respect the setting 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 using the hold command or 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