Skip to content

Commit c85c67b

Browse files
committed
Merge pull request matplotlib#4356 from mscross/examples_streamplot_feat
STY : update streamplot_demo_features.py style
2 parents 55f0fb3 + e36a734 commit c85c67b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/images_contours_and_fields/streamplot_demo_features.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
V = 1 + X - Y**2
1717
speed = np.sqrt(U*U + V*V)
1818

19-
plt.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn)
20-
plt.colorbar()
19+
fig0, ax0 = plt.subplots()
20+
strm = ax0.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn)
21+
fig0.colorbar(strm.lines)
2122

22-
f, (ax1, ax2) = plt.subplots(ncols=2)
23+
fig1, (ax1, ax2) = plt.subplots(ncols=2)
2324
ax1.streamplot(X, Y, U, V, density=[0.5, 1])
2425

25-
lw = 5*speed/speed.max()
26+
lw = 5*speed / speed.max()
2627
ax2.streamplot(X, Y, U, V, density=0.6, color='k', linewidth=lw)
2728

2829
plt.show()

0 commit comments

Comments
 (0)