
close all;
clear all;

% Simple Example Script to plot a straight line using Symbolic Toolbox
syms x;


m=2;
c= -6;

y = m*x +c;


ezplot(y);


%%%  Plot X and Y axes and label

title('y = 2x - 6')

hold on
plot([-6 6],[0 0],'-k'); % X Axis
plot([0 0],[-20 6],'-k'); % Y Axis

axis tight

%  Plot c y axis intercept

plot(0,c,'o','LineWidth',2,...
                'MarkerEdgeColor','k',...
                'MarkerFaceColor','r',...
                'MarkerSize',10);

%  Plot -c/m x axis intercept

plot(-c/m,0,'o','LineWidth',2,...
                'MarkerEdgeColor','k',...
                'MarkerFaceColor','b',...
                'MarkerSize',10);
            
% label intercepts

offset = 0.5;

text(0+offset,c,'(0,c=-6)');

text(-c/m,0-2*offset, '(-c/m=3,0)');


shg; % Show Figure