@@ -544,6 +544,9 @@ def __init__(self, fig,
544544 else :
545545 axes_class , axes_class_args = axes_class
546546
547+ adjustable = axes_class_args .setdefault ("adjustable" , "box-forced" )
548+ if adjustable != "box-forced" :
549+ raise RuntimeError ("adjustable parameter must not be set, or set to box-forced" )
547550
548551
549552 self .axes_all = []
@@ -582,28 +585,31 @@ def __init__(self, fig,
582585 col , row = self ._get_col_row (i )
583586
584587 if share_all :
585- sharex = self ._refax
586- sharey = self ._refax
588+ if self .axes_all :
589+ sharex = self .axes_all [0 ]
590+ sharey = self .axes_all [0 ]
591+ else :
592+ sharex = None
593+ sharey = None
587594 else :
588595 sharex = self ._column_refax [col ]
589596 sharey = self ._row_refax [row ]
590597
591598 ax = axes_class (fig , rect , sharex = sharex , sharey = sharey ,
592599 ** axes_class_args )
593600
594- if share_all :
595- if self ._refax is None :
596- self ._refax = ax
597- else :
598- if sharex is None :
599- self ._column_refax [col ] = ax
600- if sharey is None :
601- self ._row_refax [row ] = ax
602-
603601 self .axes_all .append (ax )
604602 self .axes_column [col ].append (ax )
605603 self .axes_row [row ].append (ax )
606604
605+ if share_all :
606+ if self ._refax is None :
607+ self ._refax = ax
608+ if sharex is None :
609+ self ._column_refax [col ] = ax
610+ if sharey is None :
611+ self ._row_refax [row ] = ax
612+
607613 cax = self ._defaultCbarAxesClass (fig , rect ,
608614 orientation = self ._colorbar_location )
609615 self .cbar_axes .append (cax )
@@ -653,13 +659,14 @@ def _update_locators(self):
653659 self .cbar_axes [0 ].set_axes_locator (locator )
654660 self .cbar_axes [0 ].set_visible (True )
655661
656- for col ,ax in enumerate (self ._column_refax ):
662+ for col ,ax in enumerate (self .axes_row [ 0 ] ):
657663 if h : h .append (self ._horiz_pad_size ) #Size.Fixed(self._axes_pad))
658664
659665 if ax :
660- sz = Size .AxesX (ax )
666+ sz = Size .AxesX (ax , aspect = "axes" , ref_ax = self . axes_all [ 0 ] )
661667 else :
662- sz = Size .AxesX (self .axes_llc )
668+ sz = Size .AxesX (self .axes_all [0 ],
669+ aspect = "axes" , ref_ax = self .axes_all [0 ])
663670
664671 if (self ._colorbar_mode == "each" or
665672 (self ._colorbar_mode == 'edge' and
@@ -682,13 +689,14 @@ def _update_locators(self):
682689
683690 v_ax_pos = []
684691 v_cb_pos = []
685- for row ,ax in enumerate (self ._row_refax [::- 1 ]):
692+ for row ,ax in enumerate (self .axes_column [ 0 ] [::- 1 ]):
686693 if v : v .append (self ._horiz_pad_size ) #Size.Fixed(self._axes_pad))
687694
688695 if ax :
689- sz = Size .AxesY (ax )
696+ sz = Size .AxesY (ax , aspect = "axes" , ref_ax = self . axes_all [ 0 ] )
690697 else :
691- sz = Size .AxesY (self .axes_llc )
698+ sz = Size .AxesY (self .axes_all [0 ],
699+ aspect = "axes" , ref_ax = self .axes_all [0 ])
692700
693701 if (self ._colorbar_mode == "each" or
694702 (self ._colorbar_mode == 'edge' and
0 commit comments