Skip to content

Commit 9875323

Browse files
committed
Change return value of streamplot.
- Return object that derives from `object` since deriving from `Container` was not beneficial. - This return value is a stopgap; the final return value should allow users to set the colormap, alpha, etc. for both lines and arrows.
1 parent 57a7d3d commit 9875323

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/matplotlib/streamplot.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import matplotlib.colors as mcolors
99
import matplotlib.collections as mcollections
1010
import matplotlib.patches as patches
11-
import matplotlib.container as container
1211

1312

1413
__all__ = ['streamplot']
@@ -50,7 +49,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
5049
5150
Returns
5251
-------
53-
*stream_container* : StreamplotContainer
52+
*stream_container* : StreamplotSet
5453
Container object with attributes
5554
lines : `matplotlib.collections.LineCollection` of streamlines
5655
arrows : collection of `matplotlib.patches.FancyArrowPatch` objects
@@ -159,19 +158,15 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
159158
axes.autoscale_view(tight=True)
160159

161160
ac = matplotlib.collections.PatchCollection(arrows)
162-
stream_container = StreamplotContainer(lc, arrows=ac)
161+
stream_container = StreamplotSet(lc, ac)
163162
return stream_container
164163

165164

166-
class StreamplotContainer(container.Container):
165+
class StreamplotSet(object):
167166

168-
def __new__(cls, *kl, **kwargs):
169-
return tuple.__new__(cls)
170-
171-
def __init__(self, lines, arrows=None, **kwargs):
167+
def __init__(self, lines, arrows, **kwargs):
172168
self.lines = lines
173169
self.arrows = arrows
174-
container.Container.__init__(self, lines, **kwargs)
175170

176171

177172
# Coordinate definitions

0 commit comments

Comments
 (0)