# Example usage of functions in plot_helpers


```python
%matplotlib notebook
import matplotlib.pyplot as plt
from 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()
```


    <IPython.core.display.Javascript object>









    (-10, 10)



## 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()
```


    <IPython.core.display.Javascript object>









    (-10, 10)




```python

```

ebc2e9bad308d6599b2e9f0523f9295a2126e311
ipynb
Jupyter Notebook
cut_material/plotting_work.ipynb
ChidinmaKO/noBSLAnotebooks
c0102473f1e6625fa5fb62768d4545059959fa26
MIT
cut_material/plotting_work.ipynb
ChidinmaKO/noBSLAnotebooks
c0102473f1e6625fa5fb62768d4545059959fa26
MIT
cut_material/plotting_work.ipynb
ChidinmaKO/noBSLAnotebooks
c0102473f1e6625fa5fb62768d4545059959fa26
MIT
Qwen/Qwen-72B
1. YES
2. YES