@@ -42,9 +42,7 @@ We will use the following imports:
42
42
import matplotlib.pyplot as plt
43
43
import numpy as np
44
44
from numpy.linalg import matrix_power
45
- from matplotlib import cm
46
45
from matplotlib.lines import Line2D
47
- from mpl_toolkits.mplot3d import Axes3D
48
46
from matplotlib.patches import FancyArrowPatch
49
47
from mpl_toolkits.mplot3d import proj3d
50
48
```
@@ -519,7 +517,8 @@ transformation $AB$ and then compare it with the transformation $BA$.
519
517
``` {code-cell} ipython3
520
518
:tags: [hide-input]
521
519
522
- def grid_composition_transform(A=np.array([[1, -1], [1, 1]]), B=np.array([[1, -1], [1, 1]])):
520
+ def grid_composition_transform(A=np.array([[1, -1], [1, 1]]),
521
+ B=np.array([[1, -1], [1, 1]])):
523
522
xvals = np.linspace(-4, 4, 9)
524
523
yvals = np.linspace(-3, 3, 7)
525
524
xygrid = np.column_stack([[x, y] for x in xvals for y in yvals])
@@ -574,7 +573,7 @@ grid_composition_transform(A, B) # transformation AB
574
573
#### Rotate then shear
575
574
576
575
``` {code-cell} ipython3
577
- grid_composition_transform(B,A) #transformation BA
576
+ grid_composition_transform(B,A) # transformation BA
578
577
```
579
578
580
579
+++ {"user_expressions": [ ] }
@@ -1241,8 +1240,8 @@ for i, example in enumerate(examples):
1241
1240
u, v = np.tensordot(M, vec_field, axes=1)
1242
1241
1243
1242
# Plot the transformed vector field
1244
- c = ax[i].streamplot(x, y, u - x, v - y,
1245
- density=1, linewidth=None, color='#A23BEC')
1243
+ c = ax[i].streamplot(x, y, u - x, v - y, density=1,
1244
+ linewidth=None, color='#A23BEC')
1246
1245
c.lines.set_alpha(0.5)
1247
1246
c.arrows.set_alpha(0.5)
1248
1247
0 commit comments