1- '''
1+ """
22Support for plotting fields of arrows.
33
44Presently this contains a single class, Quiver, but it
77This will also become a home for things such as standard
88deviation ellipses, which can and will be derived very easily from
99the Quiver code.
10- '''
10+ """
1111
1212
13- _quiver_doc = '''
13+ _quiver_doc = """
1414Plot a 2-D field of arrows.
1515
1616Function signatures:
9797 linewidths = (1,), edgecolors = ('g',)
9898 to make the arrows have green outlines of unit width.
9999
100- '''
100+ """
101101
102- _quiverkey_doc = '''
102+ _quiverkey_doc = """
103103Add a key to a quiver plot.
104104
105105Function signature:
138138 positions the head, and if labelpos is 'W', X,Y positions the
139139 tail; in either of these two cases, X,Y is somewhere in the middle
140140 of the arrow+label key object.
141- '''
141+ """
142142
143143from matplotlib .collections import PolyCollection
144144from matplotlib .mlab import meshgrid
151151
152152
153153class QuiverKey (Artist ):
154- ''' Labelled arrow for use as a quiver plot scale key.
155- '''
154+ """ Labelled arrow for use as a quiver plot scale key.
155+ """
156156 halign = {'N' : 'center' , 'S' : 'center' , 'E' : 'left' , 'W' : 'right' }
157157 valign = {'N' : 'bottom' , 'S' : 'top' , 'E' : 'center' , 'W' : 'center' }
158158 pivot = {'N' : 'mid' , 'S' : 'mid' , 'E' : 'tip' , 'W' : 'tail' }
@@ -242,7 +242,7 @@ def _set_transform(self):
242242 quiverkey_doc = _quiverkey_doc
243243
244244class Quiver (PolyCollection ):
245- '''
245+ """
246246 Specialized PolyCollection for arrows.
247247
248248 The only API method is set_UVC(), which can be used
@@ -257,7 +257,7 @@ class Quiver(PolyCollection):
257257 is limited to things that might have changed, so there
258258 should be no performance penalty from putting the calculations
259259 in the draw() method.
260- '''
260+ """
261261 def __init__ (self , ax , * args , ** kw ):
262262 self .ax = ax
263263 X , Y , U , V , C = self ._parse_args (* args )
@@ -285,11 +285,11 @@ def __init__(self, ax, *args, **kw):
285285 self .keyvec = None
286286 self .keytext = None
287287
288- __init__ .__doc__ = '''
288+ __init__ .__doc__ = """
289289 The constructor takes one required argument, an Axes
290290 instance, followed by the args and kwargs described
291291 by the following pylab interface documentation:
292- %s''' % _quiver_doc
292+ %s""" % _quiver_doc
293293
294294 def _parse_args (self , * args ):
295295 X , Y , U , V , C = [None ]* 5
@@ -313,9 +313,9 @@ def _parse_args(self, *args):
313313 return X , Y , U , V , C
314314
315315 def _init (self ):
316- ''' initialization delayed until first draw;
316+ """ initialization delayed until first draw;
317317 allow time for axes setup.
318- '''
318+ """
319319 if not self ._initialized :
320320 trans = self ._set_transform ()
321321 ax = self .ax
@@ -394,7 +394,7 @@ def _make_verts(self, U, V):
394394
395395
396396 def _h_arrows (self , length ):
397- ''' length is in arrow width units '''
397+ """ length is in arrow width units """
398398 minsh = self .minshaft * self .headlength
399399 N = len (length )
400400 length = nx .reshape (length , (N ,1 ))
0 commit comments