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

Skip to content

Commit 0662d07

Browse files
author
Manuel Jung
committed
Revision changes
1 parent 6a0bcf8 commit 0662d07

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Maximum streamline length and integration direction can now be specified
22
------------------------------------------------------------------------
33

4-
This allows to follow the vector field for a longer time and can enhance the visibilty of the flow pattern in some use cases.
4+
This allows to follow the vector field for a longer time and can enhance the
5+
visibility of the flow pattern in some use cases.

lib/matplotlib/streamplot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
6161
any number
6262
*maxlength* : float
6363
Maximum length of streamline in axes coordinates.
64-
*integration_direction* : ['foward','backward','both']
64+
*integration_direction* : ['forward', 'backward', 'both']
6565
Integrate the streamline in forward, backward or both directions.
6666
6767
Returns:
@@ -101,9 +101,9 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
101101
arrow_kw = dict(arrowstyle=arrowstyle, mutation_scale=10 * arrowsize)
102102

103103
if integration_direction not in ['both', 'forward', 'backward']:
104-
errstr = ("Integration direction '%s' not recognised." %
105-
integration_direction)
106-
errstr += "Expected 'both', 'forward' or 'backward'."
104+
errstr = ("Integration direction '%s' not recognised."
105+
"Expected 'both', 'forward' or 'backward'." %
106+
integration_direction)
107107
raise ValueError(errstr)
108108

109109
if integration_direction == 'both':
@@ -466,8 +466,8 @@ def integrate(x0, y0):
466466
dmap.reset_start_point(x0, y0)
467467
s, xt, yt = _integrate_rk12(x0, y0, dmap, forward_time, maxlength)
468468
if len(x_traj) > 0:
469-
xt = xt[1:]
470-
yt = yt[1:]
469+
xt = xt[1:]
470+
yt = yt[1:]
471471
stotal += s
472472
x_traj += xt
473473
y_traj += yt

lib/matplotlib/tests/test_streamplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ def test_masks_and_nans():
6969
extensions=['png'])
7070
def test_maxlength():
7171
x, y, U, V = swirl_velocity_field()
72-
plt.streamplot(x, y, U, V, maxlength=10., start_points=[[0.,1.5]],
73-
linewidth=2,density=2)
72+
plt.streamplot(x, y, U, V, maxlength=10., start_points=[[0., 1.5]],
73+
linewidth=2, density=2)
7474

7575

7676
@image_comparison(baseline_images=['streamplot_direction'],
7777
extensions=['png'])
7878
def test_direction():
7979
x, y, U, V = swirl_velocity_field()
8080
plt.streamplot(x, y, U, V, integration_direction='backward',
81-
maxlength=1.5, start_points=[[1.5,0.]],
81+
maxlength=1.5, start_points=[[1.5, 0.]],
8282
linewidth=2, density=2)
8383

8484

0 commit comments

Comments
 (0)