@@ -587,7 +587,6 @@ class HBoxDivider(SubplotDivider):
587
587
def _determine_karray (equivalent_sizes , appended_sizes ,
588
588
max_equivalent_size ,
589
589
total_appended_size ):
590
-
591
590
n = len (equivalent_sizes )
592
591
eq_rs , eq_as = np .asarray (equivalent_sizes ).T
593
592
ap_rs , ap_as = np .asarray (appended_sizes ).T
@@ -598,12 +597,14 @@ def _determine_karray(equivalent_sizes, appended_sizes,
598
597
A [- 1 , :- 1 ] = ap_rs
599
598
B [:n ] = - eq_as
600
599
B [- 1 ] = total_appended_size - sum (ap_as )
601
-
602
- karray_H = np .linalg .solve (A , B ) # A @ K = B
600
+ # A @ K = B: This solves for {k_0, ..., k_{N-1}, H} so that
601
+ # eq_r_i * k_i + eq_a_i = H for all i: all axes have the same height
602
+ # sum(ap_r_i * k_i + ap_a_i) = total_appended_size: fixed total width
603
+ # (foo_r_i * k_i + foo_a_i will end up being the size of foo.)
604
+ karray_H = np .linalg .solve (A , B )
603
605
karray = karray_H [:- 1 ]
604
606
H = karray_H [- 1 ]
605
-
606
- if H > max_equivalent_size :
607
+ if H > max_equivalent_size : # Additionally, upper-bound the height.
607
608
karray = (max_equivalent_size - eq_as ) / eq_rs
608
609
return karray
609
610
@@ -625,8 +626,6 @@ def new_locator(self, nx, nx1=None):
625
626
cell. When *nx1* is None, a single *nx*-th column is
626
627
specified. Otherwise location of columns spanning between *nx*
627
628
to *nx1* (but excluding *nx1*-th column) is specified.
628
- ny, ny1 : int
629
- Same as *nx* and *nx1*, but for row positions.
630
629
"""
631
630
return AxesLocator (self , nx , 0 , nx1 , None )
632
631
@@ -655,21 +654,7 @@ def _locate(self, x, y, w, h,
655
654
return x0 , y0 , ox , hh
656
655
657
656
def locate (self , nx , ny , nx1 = None , ny1 = None , axes = None , renderer = None ):
658
- """
659
- Parameters
660
- ----------
661
- axes_divider : AxesDivider
662
- nx, nx1 : int
663
- Integers specifying the column-position of the
664
- cell. When *nx1* is None, a single *nx*-th column is
665
- specified. Otherwise location of columns spanning between *nx*
666
- to *nx1* (but excluding *nx1*-th column) is specified.
667
- ny, ny1 : int
668
- Same as *nx* and *nx1*, but for row positions.
669
- axes
670
- renderer
671
- """
672
-
657
+ # docstring inherited
673
658
figW , figH = self ._fig .get_size_inches ()
674
659
x , y , w , h = self .get_position_runtime (axes , renderer )
675
660
@@ -707,27 +692,12 @@ def new_locator(self, ny, ny1=None):
707
692
return AxesLocator (self , 0 , ny , None , ny1 )
708
693
709
694
def locate (self , nx , ny , nx1 = None , ny1 = None , axes = None , renderer = None ):
710
- """
711
- Parameters
712
- ----------
713
- axes_divider : AxesDivider
714
- nx, nx1 : int
715
- Integers specifying the column-position of the
716
- cell. When *nx1* is None, a single *nx*-th column is
717
- specified. Otherwise location of columns spanning between *nx*
718
- to *nx1* (but excluding *nx1*-th column) is specified.
719
- ny, ny1 : int
720
- Same as *nx* and *nx1*, but for row positions.
721
- axes
722
- renderer
723
- """
724
-
695
+ # docstring inherited
725
696
figW , figH = self ._fig .get_size_inches ()
726
697
x , y , w , h = self .get_position_runtime (axes , renderer )
727
698
728
699
x_equivalent_sizes = self .get_horizontal_sizes (renderer )
729
700
y_appended_sizes = self .get_vertical_sizes (renderer )
730
-
731
701
y0 , x0 , oy , ww = self ._locate (y , x , h , w ,
732
702
x_equivalent_sizes , y_appended_sizes ,
733
703
figH , figW )
0 commit comments