![example picture for line()](/images/reference/Sketch_line_0.png)
```python
def setup():
py5.line(30, 20, 85, 75)
```
![example picture for line()](/images/reference/Sketch_line_1.png)
```python
def setup():
py5.line(30, 20, 85, 20)
py5.stroke(126)
py5.line(85, 20, 85, 75)
py5.stroke(255)
py5.line(85, 75, 30, 75)
```
![example picture for line()](/images/reference/Sketch_line_2.png)
```python
def setup():
py5.size(100, 100, py5.P3D)
# drawing lines in 3D requires P3D
# as a parameter to size()
py5.line(30, 20, 0, 85, 20, 15)
py5.stroke(126)
py5.line(85, 20, 15, 85, 75, 0)
py5.stroke(255)
py5.line(85, 75, 0, 30, 75, -50)
```