Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7565ad9

Browse files
committed
FIX single row XGrid- single x spine now appears at bottom, not top
1 parent 363e944 commit 7565ad9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

trendvis/gridclass.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def __init__(self, xratios, yratios, mainax_x, figsize, **kwargs):
8989
'right': ['top', 'bottom', 'left'],
9090
'none' : ['top', 'bottom', 'left',
9191
'right']},
92-
'bottom' : {'left' : ['top', 'right'],
93-
'right': ['top', 'left'],
94-
'none' : ['top', 'left',
95-
'right']},
92+
'bottom': {'left' : ['top', 'right'],
93+
'right': ['top', 'left'],
94+
'none' : ['top', 'left',
95+
'right']},
9696
'both' : {'left' : ['right'],
9797
'right': ['left'],
9898
'none' : ['right', 'left']}}
@@ -126,10 +126,10 @@ def __init__(self, xratios, yratios, mainax_x, figsize, **kwargs):
126126
'bottom': ['top', 'left', 'right'],
127127
'none' : ['top', 'bottom', 'left',
128128
'right']},
129-
'right' : {'top' : ['bottom', 'left'],
130-
'bottom': ['top', 'left'],
131-
'none' : ['top', 'bottom',
132-
'left']},
129+
'right': {'top' : ['bottom', 'left'],
130+
'bottom': ['top', 'left'],
131+
'none' : ['top', 'bottom',
132+
'left']},
133133
'both' : {'top' : ['bottom'],
134134
'bottom': ['top'],
135135
'none' : ['top', 'bottom']}}
@@ -183,6 +183,8 @@ def set_stackposition(self, onespine_forboth):
183183
# Position list in the case of a stack of 1
184184
if self.stackdim == 1:
185185
if onespine_forboth:
186+
if self.mainax_id is 'x':
187+
self.startpos = 'bottom'
186188
self.stackpos_list = [self.startpos]
187189
else:
188190
self.stackpos_list = ['both']
@@ -574,7 +576,7 @@ def autocolor_spines(self, ticks_only=False):
574576
except AttributeError:
575577
color = ax.get_children()[2].get_facecolor()
576578
if len(color) < 3:
577-
color = color[0]
579+
color = color[0]
578580
self.set_axcolor(ax, color, ticks_only=ticks_only)
579581

580582
def set_axcolor(self, ax, color, ticks_only=False, spines_only=False):
@@ -718,7 +720,7 @@ def draw_bar(self, ll_axis, ur_axis, bar_limits, orientation='vertical',
718720
self.bf_llaxis.append(ll_axis)
719721
self.bf_uraxis.append(ur_axis)
720722

721-
ll_corner = self._convert_coords(ll_axis, (lldx, lldy))
723+
ll_corner = self._convert_coords(ll_axis, (lldx, lldy))
722724
ur_corner = self._convert_coords(ur_axis, (urdx, urdy))
723725

724726
width, height = self._rect_dim(ur_corner, ll_corner)

0 commit comments

Comments
 (0)