help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plot a line passing through two points to the axis


From: Victor Semanic
Subject: Plot a line passing through two points to the axis
Date: Thu, 3 Oct 2013 17:12:16 -0700 (PDT)

Hello: I am plotting a line in Octave by having the line run through two points.
Here are the commands:

octave:3> axis([-1,1,-1,1])
octave:4> hold on
octave:5> plot(2*rand(1,2)-1, 2*rand(1,2)-1)

The line plots fine.  However, I want to extend the line such that it touches
the x and y axes.  When the points in the plot() command are nearby
each other, the line is short.  What I want to do is to extend the line such
that it touches the axes.

Can anyone suggest how to do this?  I would appreciate it very much.

Thank you so much.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]