Graphics Previous page   Next Page

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.

The graph shows a semilogarithmic scale on the x-axis and a linear scale on the y-axis. The semilogx plot is drawn with blue plus signs and the linear plot is drawn with green dashed lines.


Previous page  Specifying the Color and Size of Lines Plotting Only the Data Points Next page

© 1994-2005 The MathWorks, Inc.