@@ -4573,11 +4573,25 @@ def quiverkey(self, *args, **kw):
45734573 return qk
45744574 quiverkey .__doc__ = mquiver .QuiverKey .quiverkey_doc
45754575
4576+ # Handle units for x and y, if they've been passed
4577+ def _quiver_units (self , args , kw ):
4578+ if len (args ) > 3 :
4579+ x , y = args [0 :2 ]
4580+ self ._process_unit_info (xdata = x , ydata = y , kwargs = kw )
4581+ x = self .convert_xunits (x )
4582+ y = self .convert_yunits (y )
4583+ return (x , y ) + args [2 :]
4584+ return args
4585+
45764586 # args can by a combination if X, Y, U, V, C and all should be replaced
45774587 @_preprocess_data (replace_all_args = True , label_namer = None )
45784588 def quiver (self , * args , ** kw ):
45794589 if not self ._hold :
45804590 self .cla ()
4591+
4592+ # Make sure units are handled for x and y values
4593+ args = self ._quiver_units (args , kw )
4594+
45814595 q = mquiver .Quiver (self , * args , ** kw )
45824596
45834597 self .add_collection (q , autolim = True )
@@ -4627,6 +4641,10 @@ def barbs(self, *args, **kw):
46274641 """
46284642 if not self ._hold :
46294643 self .cla ()
4644+
4645+ # Make sure units are handled for x and y values
4646+ args = self ._quiver_units (args , kw )
4647+
46304648 b = mquiver .Barbs (self , * args , ** kw )
46314649 self .add_collection (b , autolim = True )
46324650 self .autoscale_view ()
0 commit comments