@@ -1325,6 +1325,7 @@ def __init__(self, data, **kwargs):
1325
1325
else :
1326
1326
self .tickoffset = 0.375
1327
1327
self .bar_width = 0.5
1328
+ self .log = kwargs .pop ('log' ,False )
1328
1329
MPLPlot .__init__ (self , data , ** kwargs )
1329
1330
1330
1331
def _args_adjust (self ):
@@ -1335,9 +1336,9 @@ def _args_adjust(self):
1335
1336
def bar_f (self ):
1336
1337
if self .kind == 'bar' :
1337
1338
def f (ax , x , y , w , start = None , ** kwds ):
1338
- return ax .bar (x , y , w , bottom = start , ** kwds )
1339
+ return ax .bar (x , y , w , bottom = start ,log = self . log , ** kwds )
1339
1340
elif self .kind == 'barh' :
1340
- def f (ax , x , y , w , start = None , ** kwds ):
1341
+ def f (ax , x , y , w , start = None , log = self . log , ** kwds ):
1341
1342
return ax .barh (x , y , w , left = start , ** kwds )
1342
1343
else :
1343
1344
raise NotImplementedError
@@ -1354,6 +1355,7 @@ def _get_colors(self):
1354
1355
return colors
1355
1356
1356
1357
def _make_plot (self ):
1358
+ import matplotlib as mpl
1357
1359
colors = self ._get_colors ()
1358
1360
rects = []
1359
1361
labels = []
@@ -1371,10 +1373,15 @@ def _make_plot(self):
1371
1373
kwds = self .kwds .copy ()
1372
1374
kwds ['color' ] = colors [i % len (colors )]
1373
1375
1376
+ # default, GH3254
1377
+ # I tried, I really did.
1378
+ start = 0 if mpl .__version__ == "1.2.1" else None
1374
1379
if self .subplots :
1375
1380
ax = self ._get_ax (i ) # self.axes[i]
1376
- rect = bar_f (ax , self .ax_pos , y ,
1377
- self .bar_width , ** kwds )
1381
+
1382
+ rect = bar_f (ax , self .ax_pos , y , self .bar_width ,
1383
+ start = start ,
1384
+ ** kwds )
1378
1385
ax .set_title (label )
1379
1386
elif self .stacked :
1380
1387
mask = y > 0
@@ -1385,6 +1392,7 @@ def _make_plot(self):
1385
1392
neg_prior = neg_prior + np .where (mask , 0 , y )
1386
1393
else :
1387
1394
rect = bar_f (ax , self .ax_pos + i * 0.75 / K , y , 0.75 / K ,
1395
+ start = start ,
1388
1396
label = label , ** kwds )
1389
1397
rects .append (rect )
1390
1398
labels .append (label )
@@ -1404,7 +1412,8 @@ def _post_plot_logic(self):
1404
1412
ax .set_xticks (self .ax_pos + self .tickoffset )
1405
1413
ax .set_xticklabels (str_index , rotation = self .rot ,
1406
1414
fontsize = self .fontsize )
1407
- ax .axhline (0 , color = 'k' , linestyle = '--' )
1415
+ if not self .log : # GH3254+
1416
+ ax .axhline (0 , color = 'k' , linestyle = '--' )
1408
1417
if name is not None :
1409
1418
ax .set_xlabel (name )
1410
1419
else :
0 commit comments