@@ -819,6 +819,9 @@ def _get_label(x_or_y, r, c, cnt, shared_axes):
819
819
820
820
return label
821
821
822
+ # Row in grid of anchor row if shared_xaxes=True
823
+ ANCHOR_ROW = 0 if ROW_DIR > 0 else rows - 1
824
+
822
825
# Function handling logic around 2d axis anchors
823
826
# Return 'x{}' | 'y{}' | 'free' | False
824
827
def _get_anchors (r , c , x_cnt , y_cnt , shared_xaxes , shared_yaxes ):
@@ -828,12 +831,10 @@ def _get_anchors(r, c, x_cnt, y_cnt, shared_xaxes, shared_yaxes):
828
831
829
832
if isinstance (shared_xaxes , bool ):
830
833
if shared_xaxes :
831
- if r == 0 :
832
- x_anchor = "y{col_cnt}" .format (col_cnt = c + 1 )
833
- else :
834
+ if r != ANCHOR_ROW :
834
835
x_anchor = False
835
836
y_anchor = 'free'
836
- if shared_yaxes and c > 0 : # TODO covers all cases?
837
+ if shared_yaxes and c != 0 : # TODO covers all cases?
837
838
y_anchor = False
838
839
return x_anchor , y_anchor
839
840
@@ -847,12 +848,10 @@ def _get_anchors(r, c, x_cnt, y_cnt, shared_xaxes, shared_yaxes):
847
848
848
849
if isinstance (shared_yaxes , bool ):
849
850
if shared_yaxes :
850
- if c == 0 :
851
- y_anchor = "x{row_cnt}" .format (row_cnt = r + 1 )
852
- else :
851
+ if c != 0 :
853
852
y_anchor = False
854
853
x_anchor = 'free'
855
- if shared_xaxes and r > 0 : # TODO covers all cases?
854
+ if shared_xaxes and r != ANCHOR_ROW : # TODO all cases?
856
855
x_anchor = False
857
856
return x_anchor , y_anchor
858
857
0 commit comments