Graph Commands

 

Table of the most useful commands for plotting graphs
hold on Allows plotting several graphs on the same figure. All commands after this one apply to a current figure, until the hold off command is used.
plot([x1 x2], [y1 y2]) plots the straight line between points (, ) and (, )
axis([minX maxX minY maxY]) specifies axis limits
legend(‘y1=equation1’, ‘y2=equation2’) sets the labels for the legend (must be after plot command)
xlabel(‘label for x axis’) sets the label for the - axis
ylabel(‘label for y axis’) sets the label for the - axis
title(‘graph title’) sets the label for the title
hold off Following commands no longer apply to the current figure.