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

Skip to content

Commit 913fdb7

Browse files
patniharshitdstansby
authored andcommitted
Remove data regeneration
1 parent 92b1196 commit 913fdb7

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

examples/images_contours_and_fields/streamplot_demo.py renamed to examples/images_contours_and_fields/plot_streamplot.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
Streamplot
44
==========
55
6-
A stream plot, or stream line plot, is used to display 2D vector fields. This
7-
example shows a few features of the stream plot function:
6+
A stream plot, or streamline plot, is used to display 2D vector fields. This
7+
example shows a few features of the streamplot function:
88
9-
* Varying the color along a stream line.
10-
* Varying the density of stream lines.
11-
* Varying the line width along a stream line.
12-
* Controlling the starting points of stream lines.
13-
* Stream lines skipping masked regions and NaN values.
9+
* Varying the color along a streamline.
10+
* Varying the density of streamlines.
11+
* Varying the line width along a streamline.
12+
* Controlling the starting points of streamlines.
13+
* Streamlines skipping masked regions and NaN values.
1414
"""
1515
import numpy as np
1616
import matplotlib.pyplot as plt
@@ -34,7 +34,7 @@
3434
ax1 = fig.add_subplot(gs[0, 1])
3535
strm = ax1.streamplot(X, Y, U, V, color=U, linewidth=2, cmap='autumn')
3636
fig.colorbar(strm.lines)
37-
ax1.set_title('Varying color')
37+
ax1.set_title('Varying Color')
3838

3939
# Varying line width along a streamline
4040
ax2 = fig.add_subplot(gs[1, 0])
@@ -43,9 +43,6 @@
4343
ax2.set_title('Varying Line Width')
4444

4545
# Controlling the starting points of the streamlines
46-
X, Y = (np.linspace(-3, 3, 100),
47-
np.linspace(-3, 3, 100))
48-
U, V = np.mgrid[-3:3:100j, 0:0:100j]
4946
seed_points = np.array([[-2, -1, 0, 1, 2, -1], [-2, -1, 0, 1, 2, 2]])
5047

5148
ax3 = fig.add_subplot(gs[1, 1])
@@ -59,12 +56,6 @@
5956
ax3.axis((-w, w, -w, w))
6057

6158
# Create a mask
62-
w = 3
63-
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
64-
U = -1 - X**2 + Y
65-
V = 1 + X - Y**2
66-
speed = np.sqrt(U*U + V*V)
67-
6859
mask = np.zeros(U.shape, dtype=bool)
6960
mask[40:60, 40:60] = True
7061
U[:20, :20] = np.nan

0 commit comments

Comments
 (0)