Tag Archives: hold on

Matlab multi line plot in the same window.

There are two common ways to plot more than 2 data on the same window.

The first method uses one line and is of the form plot(xfunction, style#1 ,x, function#2style#2, ). For example,

The second method involves the use of the “hold on” and “hold off” commands. After creating the first graph, use the “hold on” command, forcing subsequent graphing commands to be placed in the same window. Now type in your second plot command. When you are through, type “hold off”. For example

hold on

To add labels to your axes, use the following

xlabel(‘this goes across’)
ylabel(‘this goes up)
hold off