Skip to content

Commit 75137ac

Browse files
directly compute nrows/ncols
1 parent 90efcfc commit 75137ac

File tree

1 file changed

+2
-2
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+2
-2
lines changed

Diff for: packages/python/plotly/plotly/express/_core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2065,8 +2065,8 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
20652065
layout_patch["legend"]["itemsizing"] = "constant"
20662066

20672067
if facet_col_wrap:
2068-
nrows = 1 + ncols // facet_col_wrap
2069-
ncols = ncols if ncols < facet_col_wrap else facet_col_wrap
2068+
nrows = math.ceil(ncols / facet_col_wrap)
2069+
ncols = min(ncols, facet_col_wrap)
20702070

20712071
if args.get("marginal_x"):
20722072
nrows += 1

0 commit comments

Comments
 (0)