Simple Two-Dimensional Line Plot

## Description

Sage can plot a line between two points.

## Sage Cell

#### Code

`line([(0,0), (1,1)])`

## Options

#### Option

Calculus teachers draw the following plot frequently on the board: not just one branch of $\arcsin$ but rather several of them: i.e., the plot of $y=\sin(x)$ for $-2\pi \leq x \leq 2 \pi$ flipped about the 45 degree line. The following Sage commands construct this:

#### Code

```
v = [(sin(x),x) for x in srange(-2*float(pi),2*float(pi),0.1)]
line(v)
```

## Tags

Primary Tags: two-dimensional plots, college algebra, precalculus, calculus

Secondary Tags:

## Related Cells

- Plotting a Circle. Plotting a circle of radius $1$ and center $(0,0)$.
- Plotting a Polygon. Plotting a polygon.
- Two-Dimensional Plots. Plotting $y = \sin(x)$ for $-10 \leq x \leq 10$.
- Parametric Plots. Constructing parametric plots.

## Attribute

Permalink:

Author: Sage Tutorial v7.6

Date: 09 Jul 2017 07:37

Submitted by: Tom Judson