@@ -471,17 +471,17 @@ def draw_title(bricks, gori, gcp, figsize):
471
471
position_dict [key ] = axtmp .get_position ()
472
472
473
473
gcp = copy .deepcopy (ggplot )
474
- fig , gcp = gcp .draw (return_ggplot = True )
475
-
476
474
if StrictVersion (plotnine_version ) >= StrictVersion ("0.12" ):
477
475
figure_subplot_wspace_ori = matplotlib .rcParams ["figure.subplot.wspace" ]
478
476
figure_subplot_hspace_ori = matplotlib .rcParams ["figure.subplot.hspace" ]
479
477
figsize_ori = gcp .theme .themeables ['figure_size' ].properties ["value" ]
480
- if figsize is None :
481
- figsize = gcp .theme .themeables ['figure_size' ].properties ["value" ]
482
478
matplotlib .rcParams ["figure.subplot.wspace" ] = figure_subplot_wspace_ori / figsize [0 ]
483
479
matplotlib .rcParams ["figure.subplot.hspace" ] = figure_subplot_hspace_ori / figsize [1 ]
480
+ fig , gcp = gcp .draw (return_ggplot = True )
481
+ if figsize is None :
482
+ figsize = gcp .theme .themeables ['figure_size' ].properties ["value" ]
484
483
else :
484
+ fig , gcp = gcp .draw (return_ggplot = True )
485
485
_themeable = fig ._themeable
486
486
_basefigure ._themeable = _themeable
487
487
figsize_ori = fig .get_size_inches ()
@@ -523,7 +523,7 @@ def draw_title(bricks, gori, gcp, figsize):
523
523
ggplot .axs [i ].spines [bar ].set_lw (gcp .axs [i ].spines [bar ].get_lw ())
524
524
ggplot .axs [i ].spines [bar ].set_ec (gcp .axs [i ].spines [bar ].get_ec ())
525
525
ggplot .axs [i ].spines [bar ].set_visible (gcp .axs [i ].spines [bar ].get_visible ())
526
-
526
+
527
527
ggplot ._setup_parameters ()
528
528
ggplot .facet .strips .generate ()
529
529
for i in range (len (ggplot .facet .strips )):
@@ -607,6 +607,10 @@ def draw_title(bricks, gori, gcp, figsize):
607
607
for key in tmp_axes_keys :
608
608
axtmp = _axes_dict [key ]
609
609
axtmp .set_position (position_dict [key ])
610
+
611
+ if StrictVersion (plotnine_version ) >= StrictVersion ("0.12" ):
612
+ matplotlib .rcParams ["figure.subplot.wspace" ] = figure_subplot_wspace_ori
613
+ matplotlib .rcParams ["figure.subplot.hspace" ] = figure_subplot_hspace_ori
610
614
return ax
611
615
612
616
else :
0 commit comments