@@ -408,10 +408,11 @@ def __init__(self, ax, *args, **kw):
408408 self .width = kw .pop ('width' , None )
409409 self .color = kw .pop ('color' , 'k' )
410410 self .pivot = kw .pop ('pivot' , 'tail' )
411+ self .transform = kw .pop ('transform' , ax .transData )
411412 kw .setdefault ('facecolors' , self .color )
412413 kw .setdefault ('linewidths' , (0 ,))
413414 collections .PolyCollection .__init__ (self , [], offsets = self .XY ,
414- transOffset = ax . transData ,
415+ transOffset = self . transform ,
415416 closed = False ,
416417 ** kw )
417418 self .polykw = kw
@@ -529,8 +530,6 @@ def _angles_lengths(self, U, V, eps=1):
529530 lengths = np .absolute (dxy [:,0 ] + dxy [:,1 ]* 1j ) / eps
530531 return angles , lengths
531532
532-
533-
534533 def _make_verts (self , U , V ):
535534 uv = (U + V * 1j )
536535 if self .angles == 'xy' and self .scale_units == 'xy' :
@@ -592,7 +591,6 @@ def _make_verts(self, U, V):
592591
593592 return XY
594593
595-
596594 def _h_arrows (self , length ):
597595 """ length is in arrow width units """
598596 # It might be possible to streamline the code
@@ -824,6 +822,7 @@ def __init__(self, ax, *args, **kw):
824822 self .barb_increments = kw .pop ('barb_increments' , dict ())
825823 self .rounding = kw .pop ('rounding' , True )
826824 self .flip = kw .pop ('flip_barb' , False )
825+ transform = kw .pop ('transform' , ax .transData )
827826
828827 #Flagcolor and and barbcolor provide convenience parameters for setting
829828 #the facecolor and edgecolor, respectively, of the barb polygon. We
@@ -851,7 +850,7 @@ def __init__(self, ax, *args, **kw):
851850 #Make a collection
852851 barb_size = self ._length ** 2 / 4 #Empirically determined
853852 collections .PolyCollection .__init__ (self , [], (barb_size ,), offsets = xy ,
854- transOffset = ax . transData , ** kw )
853+ transOffset = transform , ** kw )
855854 self .set_transform (transforms .IdentityTransform ())
856855
857856 self .set_UVC (u , v , c )
0 commit comments