Skip to content

Commit c60bfe2

Browse files
author
Manuel Jung
committed
Copy streamplot interface addition to axes and pyplot interfaces.
1 parent b14d46d commit c60bfe2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4605,7 +4605,7 @@ def stackplot(self, x, *args, **kwargs):
46054605
label_namer=None)
46064606
def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
46074607
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
4608-
minlength=0.1, transform=None, zorder=None,
4608+
minlength=0.1, maxlength=2.0, transform=None, zorder=None,
46094609
start_points=None):
46104610
if not self._hold:
46114611
self.cla()
@@ -4618,6 +4618,7 @@ def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
46184618
arrowsize=arrowsize,
46194619
arrowstyle=arrowstyle,
46204620
minlength=minlength,
4621+
maxlength=maxlength,
46214622
start_points=start_points,
46224623
transform=transform,
46234624
zorder=zorder)

lib/matplotlib/pyplot.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,8 +3288,8 @@ def step(x, y, *args, **kwargs):
32883288
@_autogen_docstring(Axes.streamplot)
32893289
def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
32903290
norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1,
3291-
transform=None, zorder=None, start_points=None, hold=None,
3292-
data=None):
3291+
transform=None, zorder=None, start_points=None, maxlength=4.0,
3292+
integration_direction='both', hold=None, data=None):
32933293
ax = gca()
32943294
# allow callers to override the hold state by passing hold=True|False
32953295
washold = ax.ishold()
@@ -3301,7 +3301,10 @@ def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
33013301
color=color, cmap=cmap, norm=norm,
33023302
arrowsize=arrowsize, arrowstyle=arrowstyle,
33033303
minlength=minlength, transform=transform,
3304-
zorder=zorder, start_points=start_points, data=data)
3304+
zorder=zorder, start_points=start_points,
3305+
maxlength=maxlength,
3306+
integration_direction=integration_direction,
3307+
data=data)
33053308
finally:
33063309
ax.hold(washold)
33073310
sci(ret.lines)

0 commit comments

Comments
 (0)