diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index 1b5aee6e0f4..4ccfa063d84 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -1330,7 +1330,7 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la main_size = 0.84 row_heights = [main_size] * (nrows - 1) + [1 - main_size] - vertical_spacing = 0.01 + vertical_spacing = 0.012 * 600 / args["height"] elif args.get("facet_col_wrap", 0): vertical_spacing = 0.07 else: @@ -1343,7 +1343,8 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la main_size = 0.84 column_widths = [main_size] * (ncols - 1) + [1 - main_size] - horizontal_spacing = 0.005 + width_adjustment = 1 if args["width"] is None else 600 / args["width"] + horizontal_spacing = 0.012 * width_adjustment else: horizontal_spacing = 0.02 else: