8000 add zorder to streamplot by mgoacolou · Pull Request #2225 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

add zorder to streamplot #2225

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 2 commits into from
Jul 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3811,7 +3811,7 @@ def stackplot(self, x, *args, **kwargs):

def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
minlength=0.1, transform=None):
minlength=0.1, transform=None, zorder=1):
if not self._hold:
self.cla()
stream_container = mstream.streamplot(self, x, y, u, v,
Expand All @@ -3823,7 +3823,8 @@ def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
arrowsize=arrowsize,
arrowstyle=arrowstyle,
minlength=minlength,
transform=transform)
transform=transform,
zorder=zorder)
return stream_container
streamplot.__doc__ = mstream.streamplot.__doc__

Expand Down
5 changes: 3 additions & 2 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,7 @@ def step(x, y, *args, **kwargs):
@_autogen_docstring(Axes.streamplot)
def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1,
transform=None, hold=None):
transform=None, hold=None, zorder=1):
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
Expand All @@ -3224,7 +3224,8 @@ def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None,
ret = ax.streamplot(x, y, u, v, density=density, linewidth=linewidth,
color=color, cmap=cmap, norm=norm,
arrowsize=arrowsize, arrowstyle=arrowstyle,
minlength=minlength, transform=transform)
minlength=minlength, transform=transform,
zorder=zorder)
draw_if_interactive()
finally:
ax.hold(washold)
Expand Down
7 changes: 6 additions & 1 deletion lib/matplotlib/streamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
minlength=0.1, transform=None):
minlength=0.1, transform=None, zorder=1):
"""Draws streamlines of a vector flow.

*x*, *y* : 1d arrays
Expand Down Expand Up @@ -47,6 +47,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
See :class:`~matplotlib.patches.FancyArrowPatch`.
*minlength* : float
Minimum length of streamline in axes coordinates.
*zorder* : int
any number

Returns:

Expand Down Expand Up @@ -98,6 +100,9 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
line_kw['linewidth'] = linewidth
arrow_kw['linewidth'] = linewidth

line_kw['zorder'] = zorder
arrow_kw['zorder'] = zorder

## Sanity checks.
assert u.shape == grid.shape
assert v.shape == grid.shape
Expand Down
0