Skip to content

Commit 804cac7

Browse files
committed
Various bugfixes, remove unused w/hflush kwargs
1 parent df1ccb6 commit 804cac7

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

proplot/axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@ def _range_gridspec(self, x):
355355
raise RuntimeError(f'Axes is not a subplot.')
356356
ss = self.get_subplotspec()
357357
if x == 'x':
358-
_, _, _, _, col1, col2 = ss.get_rows_columns()
358+
_, _, _, _, col1, col2 = ss.get_active_rows_columns()
359359
return col1, col2
360360
else:
361-
_, _, row1, row2, _, _ = ss.get_rows_columns()
361+
_, _, row1, row2, _, _ = ss.get_active_rows_columns()
362362
return row1, row2
363363

364364
def _range_tightbbox(self, x):
@@ -573,7 +573,7 @@ def _update_axislabels(self, x='x', **kwargs):
573573

574574
# Apply to spanning axes and their panels
575575
axs = [ax]
576-
if getattr(ax, '_span' + x + '_on'):
576+
if getattr(ax.figure, '_span' + x):
577577
s = axis.get_label_position()[0]
578578
if s in 'lb':
579579
axs = ax._get_side_axes(s)
@@ -1870,7 +1870,7 @@ def _hide_labels(self):
18701870
axis = getattr(self, x + 'axis')
18711871
share = getattr(self, '_share' + x)
18721872
if share is not None:
1873-
level = getattr(self, '_share' + x + '_level')
1873+
level = getattr(self.figure, '_share' + x)
18741874
if level > 0:
18751875
axis.label.set_visible(False)
18761876
if level > 2:

proplot/subplots.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,7 @@ def _adjust_tight_layout(self, renderer, resize=True):
11751175
bottom = bbox.ymin
11761176
right = obox.xmax - bbox.xmax
11771177
top = obox.ymax - bbox.ymax
1178+
11781179
# Apply new bounds, permitting user overrides
11791180
# TODO: Account for bounding box NaNs?
11801181
for key, offset in zip(
@@ -1190,9 +1191,11 @@ def _adjust_tight_layout(self, renderer, resize=True):
11901191
panelpad = self._panelpad
11911192
gridspec = self._gridspec_main
11921193
nrows, ncols = gridspec.get_active_geometry()
1193-
wspace, hspace = subplots_kw['wspace'], subplots_kw['hspace']
1194+
wspace = subplots_kw['wspace']
1195+
hspace = subplots_kw['hspace']
11941196
wspace_orig = subplots_orig_kw['wspace']
11951197
hspace_orig = subplots_orig_kw['hspace']
1198+
11961199
# Get new subplot spacings, axes panel spacing, figure panel spacing
11971200
spaces = []
11981201
for (w, x, y, nacross, ispace, ispace_orig) in zip(
@@ -1256,7 +1259,6 @@ def _adjust_tight_layout(self, renderer, resize=True):
12561259
x2 = min(ax._range_tightbbox(x)[0] for ax in group2)
12571260
jspaces.append((x2 - x1) / self.dpi)
12581261
if jspaces:
1259-
# TODO: why max 0?
12601262
space = max(0, space - min(jspaces) + pad)
12611263
space = _notNone(space_orig, space) # user input overwrite
12621264
jspace[i] = space
@@ -1288,10 +1290,9 @@ def _align_axislabels(self, b=True):
12881290
if not isinstance(ax, axes.XYAxes):
12891291
continue
12901292
for x, axis in zip('xy', (ax.xaxis, ax.yaxis)):
1291-
# top or bottom, left or right
12921293
s = axis.get_label_position()[0]
1293-
span = getattr(ax, '_span' + x + '_on')
1294-
align = getattr(ax, '_align' + x + '_on')
1294+
span = getattr(self, '_span' + x)
1295+
align = getattr(self, '_align' + x)
12951296
if s not in 'bl' or axis in tracker:
12961297
continue
12971298
axs = ax._get_side_axes(s)
@@ -1336,8 +1337,9 @@ def _align_axislabels(self, b=True):
13361337
mtransforms.IdentityTransform(), self.transFigure)
13371338
for axis in axises:
13381339
axis.label.set_visible((axis is spanaxis))
1339-
spanlabel.update(
1340-
{'position': position, 'transform': transform})
1340+
spanlabel.update({
1341+
'position': position, 'transform': transform
1342+
})
13411343

13421344
def _align_labels(self, renderer):
13431345
"""Adjusts position of row and column labels, and aligns figure super
@@ -2046,11 +2048,7 @@ def subplots(
20462048
hspace=None, wspace=None, space=None,
20472049
hratios=None, wratios=None,
20482050
width_ratios=None, height_ratios=None,
2049-
flush=None, wflush=None, hflush=None,
20502051
left=None, bottom=None, right=None, top=None,
2051-
span=None, spanx=None, spany=None,
2052-
align=None, alignx=None, aligny=None,
2053-
share=None, sharex=None, sharey=None,
20542052
basemap=False, proj=None, projection=None,
20552053
proj_kw=None, projection_kw=None,
20562054
**kwargs

0 commit comments

Comments
 (0)