Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit baaadcf

Browse files
committed
Same vector field as other examples & more demonstrative seeds
1 parent 6f5f347 commit baaadcf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/images_contours_and_fields/streamplot_demo_start_points.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import numpy as np
88
import matplotlib.pyplot as plt
99

10-
X, Y = (np.linspace(-3, 3, 100),
11-
np.linspace(-3, 3, 100))
10+
Y, X = np.mgrid[-3:3:100j, -3:3:100j]
11+
U = -1 - X**2 + Y
12+
V = 1 + X - Y**2
1213

13-
U, V = np.mgrid[-3:3:100j, 0:0:100j]
14-
15-
seed_points = np.array([[-2, 0, 1], [-2, 0, 1]])
14+
# 5 points along the first diagonal and a point in the left upper quadrant
15+
seed_points = np.array([[-2, -1, 0, 1, 2, -1], [-2, -1, 0, 1, 2, 2]])
1616

1717
fig, ax = plt.subplots()
1818
strm = ax.streamplot(X, Y, U, V, color=U, linewidth=2,

0 commit comments

Comments
 (0)