@@ -178,7 +178,11 @@ def __call__(self, *args, **kwargs):
178
178
179
179
if self .axes .xaxis is not None and self .axes .yaxis is not None :
180
180
xunits = kwargs .pop ( 'xunits' , self .axes .xaxis .units )
181
+ if self .axes .name == 'polar' :
182
+ xunits = kwargs .pop ( 'thetaunits' , xunits )
181
183
yunits = kwargs .pop ( 'yunits' , self .axes .yaxis .units )
184
+ if self .axes .name == 'polar' :
185
+ yunits = kwargs .pop ( 'runits' , yunits )
182
186
if xunits != self .axes .xaxis .units :
183
187
self .axes .xaxis .set_units (xunits )
184
188
if yunits != self .axes .yaxis .units :
@@ -1554,6 +1558,8 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
1554
1558
# process kwargs 2nd since these will override default units
1555
1559
if kwargs is not None :
1556
1560
xunits = kwargs .pop ( 'xunits' , self .xaxis .units )
1561
+ if self .name == 'polar' :
1562
+ xunits = kwargs .pop ( 'thetaunits' , xunits )
1557
1563
if xunits != self .xaxis .units :
1558
1564
#print '\tkw setting xunits', xunits
1559
1565
self .xaxis .set_units (xunits )
@@ -1563,6 +1569,8 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
1563
1569
self .xaxis .update_units (xdata )
1564
1570
1565
1571
yunits = kwargs .pop ('yunits' , self .yaxis .units )
1572
+ if self .name == 'polar' :
1573
+ yunits = kwargs .pop ( 'runits' , yunits )
1566
1574
if yunits != self .yaxis .units :
1567
1575
#print '\tkw setting yunits', yunits
1568
1576
self .yaxis .set_units (yunits )
@@ -3953,7 +3961,6 @@ def semilogx(self, *args, **kwargs):
3953
3961
}
3954
3962
3955
3963
self .set_xscale ('log' , ** d )
3956
- self .set_yscale ('linear' )
3957
3964
b = self ._hold
3958
3965
self ._hold = True # we've already processed the hold
3959
3966
l = self .plot (* args , ** kwargs )
@@ -4004,7 +4011,6 @@ def semilogy(self, *args, **kwargs):
4004
4011
'nonposy' : kwargs .pop ('nonposy' , 'mask' ),
4005
4012
}
4006
4013
self .set_yscale ('log' , ** d )
4007
- self .set_xscale ('linear' )
4008
4014
b = self ._hold
4009
4015
self ._hold = True # we've already processed the hold
4010
4016
l = self .plot (* args , ** kwargs )
@@ -6286,6 +6292,13 @@ def arrow(self, x, y, dx, dy, **kwargs):
6286
6292
6287
6293
.. plot:: mpl_examples/pylab_examples/arrow_demo.py
6288
6294
"""
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
+
6289
6302
a = mpatches .FancyArrow (x , y , dx , dy , ** kwargs )
6290
6303
self .add_artist (a )
6291
6304
return a
0 commit comments