newplot
Specify where to draw graphics objects
Description
newplot
prepares the current axes for a new plot by ensuring
that the new plot either adds to or replaces the existing plot. The behavior of
newplot
depends on the NextPlot
property
of both the axes and its parent figure. For more information, see Algorithms.
If no axes exist, newplot
creates a new Cartesian axes object
in the current figure.
For a simple 2D plot, use the plot
function instead.
newplot(
updates the specified axes
ax
)ax
instead of the current axes. You can use this
newplot
syntax at the beginning of your graphics code to
determine which axes and figure to target with subsequent plotting commands.
returns
the cax
= newplot(___)Axes
object. Specify the output argument with
either of the previous syntaxes. Use cax
to query and modify
axes properties after creation. For a list of properties, see Axes Properties.
Examples
Input Arguments
Algorithms
The behavior of the newplot
function depends on both the
NextPlot
property of the figure and the
NextPlot
property of the axes.
First, the newplot
function queries the NextPlot
property of the
figure. This table shows how the newplot
function changes the
figure based on the value of NextPlot
.
Value of  Behavior of 






This behavior is equivalent to using the 

This behavior is equivalent to using the 
Then, the newplot
function queries the NextPlot
property of the
axes in the figure. This table shows how the newplot
function
changes the axes based on the value of its NextPlot
property.
Value of  Behavior of 


This behavior is equivalent to calling the 



This behavior is equivalent to calling the 

For axes with only one yaxis, the

Version History
Introduced before R2006a