Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c85c67b

Browse filesBrowse 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
Copy full SHA for c85c67b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed

‎examples/images_contours_and_fields/streamplot_demo_features.py

Copy file name to clipboardExpand all lines: examples/images_contours_and_fields/streamplot_demo_features.py
+5-4Lines changed: 5 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.