Hi all,
I have a graph of points using
plot(p1x,p1y,'X')
hold on;
plot(p2x,p2y,'X')
plot(p3x,p3y,'X')
plot(p4x,p4y,'X')
hold off;
title('')
xlabel('')
ylabel('')
grid
but i want to have a line from (0,0) to the points i have. I would love to have an arrow, but i line will do. I can't seem to get it to work I've had some crazy lines going in seemly ramdom directions.
Any help wold great :-)
Thanks
I have a graph of points using
plot(p1x,p1y,'X')
hold on;
plot(p2x,p2y,'X')
plot(p3x,p3y,'X')
plot(p4x,p4y,'X')
hold off;
title('')
xlabel('')
ylabel('')
grid
but i want to have a line from (0,0) to the points i have. I would love to have an arrow, but i line will do. I can't seem to get it to work I've had some crazy lines going in seemly ramdom directions.
Any help wold great :-)
Thanks
-
% from (0, 0) to (3, 4)
x = linspace(0, 3, 100);
y = linspace(0, 4, 100);
plot(x,y)
hold on
% from (0, 0) to (5, 3)
x = linspace(0, 5, 100);
y = linspace(0, 3, 100);
plot(x,y)
x = linspace(0, 3, 100);
y = linspace(0, 4, 100);
plot(x,y)
hold on
% from (0, 0) to (5, 3)
x = linspace(0, 5, 100);
y = linspace(0, 3, 100);
plot(x,y)