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

Merged streamline examples #8336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 12, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove data regeneration
  • Loading branch information
patniharshit authored and dstansby committed Apr 12, 2017
commit 913fdb7331c0b5d6ddc0ea8f07e1a19ba7585b74
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Streamplot
==========

A stream plot, or stream line plot, is used to display 2D vector fields. This
example shows a few features of the stream plot function:
A stream plot, or streamline plot, is used to display 2D vector fields. This
example shows a few features of the streamplot function:

* Varying the color along a stream line.
* Varying the density of stream lines.
* Varying the line width along a stream line.
* Controlling the starting points of stream lines.
* Stream lines skipping masked regions and NaN values.
* Varying the color along a streamline.
* Varying the density of streamlines.
* Varying the line width along a streamline.
* Controlling the starting points of streamlines.
* Streamlines skipping masked regions and NaN values.
"""
import numpy as np
import matplotlib.pyplot as plt
Expand All @@ -34,7 +34,7 @@
ax1 = fig.add_subplot(gs[0, 1])
strm = ax1.streamplot(X, Y, U, V, color=U, linewidth=2, cmap='autumn')
fig.colorbar(strm.lines)
ax1.set_title('Varying color')
ax1.set_title('Varying Color')

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

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

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

# Create a mask
w = 3
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
U = -1 - X**2 + Y
V = 1 + X - Y**2
speed = np.sqrt(U*U + V*V)

mask = np.zeros(U.shape, dtype=bool)
mask[40:60, 40:60] = True
U[:20, :20] = np.nan
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.