Skip to content

Commit e67ade8

Browse files
author
Manuel Jung
committed
Comply with pep8.
1 parent 6cef6bc commit e67ade8

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4606,23 +4606,24 @@ def stackplot(self, x, *args, **kwargs):
46064606
def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
46074607
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
46084608
minlength=0.1, maxlength=4.0, transform=None, zorder=None,
4609-
start_points=None,integration_direction='both'):
4609+
start_points=None, integration_direction='both'):
46104610
if not self._hold:
46114611
self.cla()
4612-
stream_container = mstream.streamplot(self, x, y, u, v,
4613-
density=density,
4614-
linewidth=linewidth,
4615-
color=color,
4616-
cmap=cmap,
4617-
norm=norm,
4618-
arrowsize=arrowsize,
4619-
arrowstyle=arrowstyle,
4620-
minlength=minlength,
4621-
maxlength=maxlength,
4622-
start_points=start_points,
4623-
transform=transform,
4624-
integration_direction=integration_direction,
4625-
zorder=zorder)
4612+
stream_container = mstream.streamplot(
4613+
self, x, y, u, v,
4614+
density=density,
4615+
linewidth=linewidth,
4616+
color=color,
4617+
cmap=cmap,
4618+
norm=norm,
4619+
arrowsize=arrowsize,
4620+
arrowstyle=arrowstyle,
4621+
minlength=minlength,
4622+
maxlength=maxlength,
4623+
start_points=start_points,
4624+
transform=transform,
4625+
integration_direction=integration_direction,
4626+
zorder=zorder)
46264627
return stream_container
46274628
streamplot.__doc__ = mstream.streamplot.__doc__
46284629

lib/matplotlib/streamplot.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
2424
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
2525
minlength=0.1, maxlength=4.0, transform=None, zorder=None,
26-
start_points=None,integration_direction='both'):
26+
start_points=None, integration_direction='both'):
2727
"""Draws streamlines of a vector flow.
2828
2929
*x*, *y* : 1d arrays
@@ -100,15 +100,15 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
100100
line_kw = {}
101101
arrow_kw = dict(arrowstyle=arrowstyle, mutation_scale=10 * arrowsize)
102102

103-
if not integration_direction in ['both','forward','backward']:
104-
errstr = "Integration direction '%s' not recognised." % integration_direction
103+
if integration_direction not in ['both', 'forward', 'backward']:
104+
errstr = "Integration direction " \
105+
"'%s' not recognised." % integration_direction
105106
errstr += "Expected 'both', 'forward' or 'backward'."
106107
raise ValueError(errstr)
107108

108-
if integration_direction=='both':
109+
if integration_direction == 'both':
109110
maxlength /= 2.
110111

111-
112112
use_multicolor_lines = isinstance(color, np.ndarray)
113113
if use_multicolor_lines:
114114
if color.shape != grid.shape:
@@ -140,7 +140,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
140140
u = np.ma.masked_invalid(u)
141141
v = np.ma.masked_invalid(v)
142142

143-
integrate = get_integrator(u, v, dmap, minlength, maxlength, integration_direction)
143+
integrate = get_integrator(u, v, dmap, minlength, maxlength,
144+
integration_direction)
144145

145146
trajectories = []
146147
if start_points is None:
@@ -455,13 +456,13 @@ def integrate(x0, y0):
455456
dmap.start_trajectory(x0, y0)
456457
except InvalidIndexError:
457458
return None
458-
if integration_direction in ['both','backward']:
459+
if integration_direction in ['both', 'backward']:
459460
s, xt, yt = _integrate_rk12(x0, y0, dmap, backward_time, maxlength)
460461
stotal += s
461462
x_traj += xt[::-1]
462463
y_traj += yt[::-1]
463464

464-
if integration_direction in ['both','forward']:
465+
if integration_direction in ['both', 'forward']:
465466
dmap.reset_start_point(x0, y0)
466467
s, xt, yt = _integrate_rk12(x0, y0, dmap, forward_time, maxlength)
467468
if len(x_traj) > 0:

0 commit comments

Comments
 (0)