# Example usage of functions in plot_helpers


```python
%matplotlib inline
import matplotlib.pyplot as plt
from util.plot_helpers import plot_vec, plot_vecs, plot_line, plot_plane, autoscale_arrows
import numpy as np
from sympy import *
```

## Plots in the plane


```python
fig = plt.figure()

# plot vectors:
u = Matrix([1,1])
v = Matrix([1,-2])
plot_vecs(u,v)
# same as:
# plot_vec(u)
# plot_vec(v)

# line plot as point + direction form:
plot_line(u,[0,1])

# line plot using normal + constant:  
nvec = Matrix([1,1])
d = 1
plot_plane(nvec,d)    # n_x*x + n_y*y = d


# manual set of plot limits
ax = plt.gca()
ax.set_xlim([-10,10])
ax.set_ylim([-10,10])

# automatic scale (ensure all vectors fit in plot)
autoscale_arrows()
```

## Three-dimensional plots


```python
fig = plt.figure()


# plot vectors:
u = Matrix([1,1,1])
v = Matrix([1,-2,0])

plot_vecs(u,v)
# same as:
# plot_vec(u)
# plot_vec(v)


# line plot as point + direction form:
plot_line(u,[0,0,1])
plot_line(v,[0,0,1],color='r')

# plane plot using normal + constant:  
plot_plane(u,2)
plot_plane(u,4)
plot_plane(u,8,xrange=[-2,2],yrange=[-2,2])


ax = plt.gca()
ax.set_xlim([-10,10])
ax.set_ylim([-10,10])
ax.set_zlim([-10,10])

# autoscale_arrows()
```


```python

```

9cee615c26b24beec2b8c16efdfa3a078763511f
ipynb
Jupyter Notebook
cut_material/plotting_work.ipynb
minireference/noBSLAnotebooks
3d6acb134266a5e304cb2d51c5ac4dc3eb3949b4
MIT
2016-04-20T13:56:02.000Z
2022-03-30T08:55:08.000Z
cut_material/plotting_work.ipynb
minireference/noBSLAnotebooks
3d6acb134266a5e304cb2d51c5ac4dc3eb3949b4
MIT
2021-07-01T17:00:38.000Z
2021-07-01T19:34:09.000Z
cut_material/plotting_work.ipynb
minireference/noBSLAnotebooks
3d6acb134266a5e304cb2d51c5ac4dc3eb3949b4
MIT
2017-02-04T05:22:23.000Z
2021-12-28T00:06:50.000Z
Qwen/Qwen-72B
1. YES
2. YES