@@ -198,10 +198,7 @@ def _valid_plot_kwargs():
198
198
'xrotation' : { 'Default' : 45 ,
199
199
'Validator' : lambda value : isinstance (value ,(int ,float )) },
200
200
201
- 'axesoff' : { 'Default' : False ,
202
- 'Validator' : lambda value : isinstance (value ,bool ) },
203
-
204
- 'axesoffdark' : { 'Default' : False ,
201
+ 'axisoff' : { 'Default' : False ,
205
202
'Validator' : lambda value : isinstance (value ,bool ) },
206
203
207
204
'closefig' : { 'Default' : 'auto' ,
@@ -628,19 +625,24 @@ def plot( data, **kwargs ):
628
625
# For now, for backwards compatibility, we flatten axes list:
629
626
axlist = [ax for axes in panels ['axes' ] for ax in axes ]
630
627
631
- if config ['axesoffdark' ]: fig .patch .set_facecolor ('black' )
632
- if config ['axesoff' ]: fig .patch .set_visible (False )
633
- if config ['axesoffdark' ] or config ['axesoff' ]:
628
+ if config ['axisoff' ]:
634
629
for ax in axlist :
635
630
ax .set_xlim (xdates [0 ],xdates [- 1 ])
636
631
ax .set_axis_off ()
637
632
638
633
if config ['savefig' ] is not None :
639
634
save = config ['savefig' ]
640
635
if isinstance (save ,dict ):
641
- plt .savefig (** save )
636
+ # Expand to fill chart if axisoff
637
+ if config ['axisoff' ] and 'bbox_inches' not in save :
638
+ plt .savefig (** save ,bbox_inches = 'tight' )
639
+ else :
640
+ plt .savefig (** save )
642
641
else :
643
- plt .savefig (save )
642
+ if config ['axisoff' ]:
643
+ plt .savefig (save ,bbox_inches = 'tight' )
644
+ else :
645
+ plt .savefig (save )
644
646
if config ['closefig' ]: # True or 'auto'
645
647
plt .close (fig )
646
648
elif not config ['returnfig' ]:
0 commit comments