Skip to content

Commit 5cf20b8

Browse files
committed
Fix issue where get_active_rows_columns returned incorrect nrows/ncols
1 parent 8005fcc commit 5cf20b8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

proplot/gridspec.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,20 @@ def get_active_rows_columns(self):
286286
last subplot row, first subplot column, and last subplot column,
287287
ignoring rows and columns allocated for spaces.
288288
"""
289-
gridspec = self.get_gridspec()
290-
nrows, ncols = gridspec.get_geometry()
289+
nrows, ncols = self.get_gridspec().get_geometry()
291290
row1, col1 = divmod(self.num1, ncols)
292291
if self.num2 is not None:
293292
row2, col2 = divmod(self.num2, ncols)
294293
else:
295294
row2 = row1
296295
col2 = col1
297296
return (
298-
nrows // 2, ncols // 2, row1 // 2, row2 // 2, col1 // 2, col2 // 2
297+
(nrows + 1) // 2,
298+
(ncols + 1) // 2,
299+
row1 // 2,
300+
row2 // 2,
301+
col1 // 2,
302+
col2 // 2
299303
)
300304

301305
def get_geometry(self):

0 commit comments

Comments
 (0)