Skip to content

Commit

Permalink
ENH plot Layout: preserve user-specified nrow & ncol
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed May 7, 2021
1 parent f3e4ada commit bebd9c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions eelbrain/plot/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,8 @@ def __init__(
elif h is None:
h = w / ax_aspect
elif nax == 1:
ncol = nrow = 1
ncol = ncol or 1
nrow = nrow or 1
elif nrow is None and ncol is None:
if w and axw:
trim = 'row'
Expand Down Expand Up @@ -2396,10 +2397,8 @@ def __init__(

if nax:
if nrow is None:
ncol = min(nax, ncol)
nrow = math.ceil(nax / ncol)
elif ncol is None:
nrow = min(nax, nrow)
ncol = math.ceil(nax / nrow)

if trim == 'row':
Expand Down

0 comments on commit bebd9c4

Please sign in to comment.