@@ -178,7 +178,11 @@ def __call__(self, *args, **kwargs):
178178
179179 if self .axes .xaxis is not None and self .axes .yaxis is not None :
180180 xunits = kwargs .pop ( 'xunits' , self .axes .xaxis .units )
181+ if self .axes .name == 'polar' :
182+ xunits = kwargs .pop ( 'thetaunits' , xunits )
181183 yunits = kwargs .pop ( 'yunits' , self .axes .yaxis .units )
184+ if self .axes .name == 'polar' :
185+ yunits = kwargs .pop ( 'runits' , yunits )
182186 if xunits != self .axes .xaxis .units :
183187 self .axes .xaxis .set_units (xunits )
184188 if yunits != self .axes .yaxis .units :
@@ -1554,6 +1558,8 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
15541558 # process kwargs 2nd since these will override default units
15551559 if kwargs is not None :
15561560 xunits = kwargs .pop ( 'xunits' , self .xaxis .units )
1561+ if self .name == 'polar' :
1562+ xunits = kwargs .pop ( 'thetaunits' , xunits )
15571563 if xunits != self .xaxis .units :
15581564 #print '\tkw setting xunits', xunits
15591565 self .xaxis .set_units (xunits )
@@ -1563,6 +1569,8 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
15631569 self .xaxis .update_units (xdata )
15641570
15651571 yunits = kwargs .pop ('yunits' , self .yaxis .units )
1572+ if self .name == 'polar' :
1573+ yunits = kwargs .pop ( 'runits' , yunits )
15661574 if yunits != self .yaxis .units :
15671575 #print '\tkw setting yunits', yunits
15681576 self .yaxis .set_units (yunits )
@@ -3953,7 +3961,6 @@ def semilogx(self, *args, **kwargs):
39533961 }
39543962
39553963 self .set_xscale ('log' , ** d )
3956- self .set_yscale ('linear' )
39573964 b = self ._hold
39583965 self ._hold = True # we've already processed the hold
39593966 l = self .plot (* args , ** kwargs )
@@ -4004,7 +4011,6 @@ def semilogy(self, *args, **kwargs):
40044011 'nonposy' : kwargs .pop ('nonposy' , 'mask' ),
40054012 }
40064013 self .set_yscale ('log' , ** d )
4007- self .set_xscale ('linear' )
40084014 b = self ._hold
40094015 self ._hold = True # we've already processed the hold
40104016 l = self .plot (* args , ** kwargs )
@@ -6286,6 +6292,13 @@ def arrow(self, x, y, dx, dy, **kwargs):
62866292
62876293 .. plot:: mpl_examples/pylab_examples/arrow_demo.py
62886294 """
6295+ # Strip away units for the underlying patch since units
6296+ # do not make sense to most patch-like code
6297+ x = self .convert_xunits (x )
6298+ y = self .convert_yunits (y )
6299+ dx = self .convert_xunits (dx )
6300+ dy = self .convert_yunits (dy )
6301+
62896302 a = mpatches .FancyArrow (x , y , dx , dy , ** kwargs )
62906303 self .add_artist (a )
62916304 return a
0 commit comments