Ask Your Question

Revision history [back]

Octave-like plot function, or, how to plot sequence of points?

Let's say I have the following set of points: (1, 2), (5, 8), (7, 13), (8, 10), (8.7, 9), (10, 6.3), (13, 2), (15, -1).

I would like to plot a 2D graph passing through them.

In octave, I can do the following:

octave:47> x = [1, 5, 7, 8, 8.7, 10, 13, 15]

octave:48> y = [2, 8, 13, 10, 9, 6.3, 2, -1]

octave:49> plot(x, y)

And I get this graph.

How can I do something similar in sage?