Graphics |
Adding Plots to an Existing Graph
You can add plots to an existing graph using the hold
command. When you set hold
to on
, MATLAB does not remove the existing graph; it adds the new data to the current graph, rescaling if the new data falls outside the range of the previous axis limits.
For example, these statements first create a semilogarithmic plot, then add a linear plot.
While MATLAB resets the x-axis limits to accommodate the new data, it does not change the scaling from logarithmic to linear.
Specifying the Color and Size of Lines | Plotting Only the Data Points |