Skip to content

Commit 10f5b60

Browse files
authored
Merge pull request #21124 from anntzer/sp
Tweak streamplot plot_types example.
2 parents 03d25d9 + 211cbc0 commit 10f5b60

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plot_types/arrays/streamplot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@
1313
# make a stream function:
1414
X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256))
1515
Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2)
16-
Z = Z - Z.min()
1716
# make U and V out of the streamfunction:
1817
V = np.diff(Z[1:, :], axis=1)
1918
U = -np.diff(Z[:, 1:], axis=0)
2019

2120
# plot:
2221
fig, ax = plt.subplots()
23-
# contour stream function
24-
ax.contour(X, Y, Z, colors='C1', alpha=0.5, zorder=1, linewidths=3)
22+
ax.grid(False)
23+
2524
# plot stream plot
26-
ax.streamplot(X[1:, 1:], Y[1:, 1:], U, V, zorder=2)
25+
ax.streamplot(X[1:, 1:], Y[1:, 1:], U, V)
2726

2827
plt.show()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy