diff --git a/plotly/_subplots.py b/plotly/_subplots.py index 16a3958637..5aa3bba1dc 100644 --- a/plotly/_subplots.py +++ b/plotly/_subplots.py @@ -57,6 +57,7 @@ def make_subplots( row_titles=None, x_title=None, y_title=None, + font=dict(size=16), figure=None, **kwargs, ): @@ -227,6 +228,9 @@ def make_subplots( Title to place to the left of the left column of subplots, centered vertically + font: dict (default dict(size=16)) + Font used by any title of the subplots. + figure: go.Figure or None (default None) If None, a new go.Figure instance will be created and its axes will be populated with those corresponding to the requested subplot geometry and @@ -814,7 +818,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname): # Add subplot titles plot_title_annotations = _build_subplot_title_annotations( - subplot_titles, list_of_domains + subplot_titles, list_of_domains, font = font ) layout["annotations"] = plot_title_annotations @@ -835,7 +839,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname): # Add subplot titles column_title_annotations = _build_subplot_title_annotations( - column_titles, domains_list + column_titles, domains_list, font = font ) layout["annotations"] += tuple(column_title_annotations) @@ -849,7 +853,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname): # Add subplot titles column_title_annotations = _build_subplot_title_annotations( - row_titles, domains_list, title_edge="right" + row_titles, domains_list, title_edge="right", font = font ) layout["annotations"] += tuple(column_title_annotations) @@ -859,7 +863,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname): # Add subplot titles column_title_annotations = _build_subplot_title_annotations( - [x_title], domains_list, title_edge="bottom", offset=30 + [x_title], domains_list, title_edge="bottom", offset=30, font = font ) layout["annotations"] += tuple(column_title_annotations) @@ -869,7 +873,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname): # Add subplot titles column_title_annotations = _build_subplot_title_annotations( - [y_title], domains_list, title_edge="left", offset=40 + [y_title], domains_list, title_edge="left", offset=40, font = font ) layout["annotations"] += tuple(column_title_annotations) @@ -1163,7 +1167,7 @@ def _get_cartesian_label(x_or_y, r, c, cnt): def _build_subplot_title_annotations( - subplot_titles, list_of_domains, title_edge="top", offset=0 + subplot_titles, list_of_domains, title_edge="top", offset=0, font=dict(size=16) ): # If shared_axes is False (default) use list_of_domains # This is used for insets and irregular layouts @@ -1236,7 +1240,7 @@ def _build_subplot_title_annotations( "yref": "paper", "text": subplot_titles[index], "showarrow": False, - "font": dict(size=16), + "font": font, "xanchor": xanchor, "yanchor": yanchor, }