Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.
  • Loading branch information...
commit 9875323ed79767751f05a109e44c5da7556e6ce2 1 parent 57a7d3d
Tony S Yu authored April 29, 2012

Showing 1 changed file with 4 additions and 9 deletions. Show diff stats Hide diff stats

  1. 13  lib/matplotlib/streamplot.py
13  lib/matplotlib/streamplot.py
@@ -8,7 +8,6 @@
8 8
 import matplotlib.colors as mcolors
9 9
 import matplotlib.collections as mcollections
10 10
 import matplotlib.patches as patches
11  
-import matplotlib.container as container
12 11
 
13 12
 
14 13
 __all__ = ['streamplot']
@@ -50,7 +49,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
50 49
 
51 50
     Returns
52 51
     -------
53  
-    *stream_container* : StreamplotContainer
  52
+    *stream_container* : StreamplotSet
54 53
         Container object with attributes
55 54
             lines : `matplotlib.collections.LineCollection` of streamlines
56 55
             arrows : collection of `matplotlib.patches.FancyArrowPatch` objects
@@ -159,19 +158,15 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
159 158
     axes.autoscale_view(tight=True)
160 159
 
161 160
     ac = matplotlib.collections.PatchCollection(arrows)
162  
-    stream_container = StreamplotContainer(lc, arrows=ac)
  161
+    stream_container = StreamplotSet(lc, ac)
163 162
     return stream_container
164 163
 
165 164
 
166  
-class StreamplotContainer(container.Container):
  165
+class StreamplotSet(object):
167 166
 
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):
172 168
         self.lines = lines
173 169
         self.arrows = arrows
174  
-        container.Container.__init__(self, lines, **kwargs)
175 170
 
176 171
 
177 172
 # Coordinate definitions

0 notes on commit 9875323

Please sign in to comment.
Something went wrong with that request. Please try again.