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

Skip to content

Commit c35d391

Browse files
committed
fix kwarg positions and start_point array conversion
1 parent 0e5d353 commit c35d391

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,7 @@ def stackplot(self, x, *args, **kwargs):
43424342

43434343
def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
43444344
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
4345-
minlength=0.1, start_points=None, transform=None, zorder=1):
4345+
minlength=0.1, transform=None, zorder=1, start_points=None):
43464346
if not self._hold:
43474347
self.cla()
43484348
stream_container = mstream.streamplot(self, x, y, u, v,

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,7 +3338,7 @@ def step(x, y, *args, **kwargs):
33383338
@_autogen_docstring(Axes.streamplot)
33393339
def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
33403340
norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1,
3341-
start_points=None, transform=None, zorder=1, hold=None):
3341+
transform=None, zorder=1, start_points=None, hold=None):
33423342
ax = gca()
33433343
# allow callers to override the hold state by passing hold=True|False
33443344
washold = ax.ishold()
@@ -3349,8 +3349,8 @@ def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
33493349
ret = ax.streamplot(x, y, u, v, density=density, linewidth=linewidth,
33503350
color=color, cmap=cmap, norm=norm,
33513351
arrowsize=arrowsize, arrowstyle=arrowstyle,
3352-
minlength=minlength, start_points=start_points,
3353-
transform=transform, zorder=zorder)
3352+
minlength=minlength, transform=transform,
3353+
zorder=zorder, start_points=start_points)
33543354
finally:
33553355
ax.hold(washold)
33563356
sci(ret.lines)

lib/matplotlib/streamplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
2323
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
24-
minlength=0.1, start_points=None, transform=None, zorder=1):
24+
minlength=0.1, transform=None, zorder=1, start_points=None):
2525
"""Draws streamlines of a vector flow.
2626
2727
*x*, *y* : 1d arrays
@@ -135,7 +135,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
135135
# Convert start_points from data to array coords
136136
# Shift the seed points from the bottom left of the data so that
137137
# data2grid works properly.
138-
sp2 = start_points.copy()
138+
sp2 = np.asanyarray(start_points, copy=True)
139139
sp2[:,0] += np.abs(x[0])
140140
sp2[:,1] += np.abs(y[0])
141141
for xs, ys in sp2:

0 commit comments

Comments
 (0)