@@ -58,6 +58,7 @@ def make_subplots(
5858x_title = None ,
5959y_title = None ,
6060figure = None ,
61+ font = None ,
6162** kwargs ,
6263):
6364"""
@@ -235,6 +236,9 @@ def make_subplots(
235236 layout of this figure and this figure will be returned. If the figure
236237 already contains axes, they will be overwritten.
237238
239+ font: dict (default None)
240+ Font used by any title of the subplots.
241+
238242 Examples
239243 --------
240244
@@ -814,7 +818,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
814818
815819# Add subplot titles
816820plot_title_annotations = _build_subplot_title_annotations (
817- subplot_titles ,list_of_domains
821+ subplot_titles ,list_of_domains , font = font
818822 )
819823
820824layout ["annotations" ]= plot_title_annotations
@@ -835,7 +839,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
835839
836840# Add subplot titles
837841column_title_annotations = _build_subplot_title_annotations (
838- column_titles ,domains_list
842+ column_titles ,domains_list , font = font
839843 )
840844
841845layout ["annotations" ]+= tuple (column_title_annotations )
@@ -849,7 +853,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
849853
850854# Add subplot titles
851855column_title_annotations = _build_subplot_title_annotations (
852- row_titles ,domains_list ,title_edge = "right"
856+ row_titles ,domains_list ,title_edge = "right" , font = font
853857 )
854858
855859layout ["annotations" ]+= tuple (column_title_annotations )
@@ -859,7 +863,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
859863
860864# Add subplot titles
861865column_title_annotations = _build_subplot_title_annotations (
862- [x_title ],domains_list ,title_edge = "bottom" ,offset = 30
866+ [x_title ],domains_list ,title_edge = "bottom" ,offset = 30 , font = font
863867 )
864868
865869layout ["annotations" ]+= tuple (column_title_annotations )
@@ -869,7 +873,7 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
869873
870874# Add subplot titles
871875column_title_annotations = _build_subplot_title_annotations (
872- [y_title ],domains_list ,title_edge = "left" ,offset = 40
876+ [y_title ],domains_list ,title_edge = "left" ,offset = 40 , font = font
873877 )
874878
875879layout ["annotations" ]+= tuple (column_title_annotations )
@@ -1163,7 +1167,7 @@ def _get_cartesian_label(x_or_y, r, c, cnt):
11631167
11641168
11651169def _build_subplot_title_annotations (
1166- subplot_titles ,list_of_domains ,title_edge = "top" ,offset = 0
1170+ subplot_titles ,list_of_domains ,title_edge = "top" ,offset = 0 , font = None
11671171):
11681172# If shared_axes is False (default) use list_of_domains
11691173# This is used for insets and irregular layouts
@@ -1173,6 +1177,10 @@ def _build_subplot_title_annotations(
11731177subtitle_pos_x = []
11741178subtitle_pos_y = []
11751179
1180+ # If no font size is provided, use this fallback
1181+ if font is None :
1182+ font = dict (size = 16 )
1183+
11761184if title_edge == "top" :
11771185text_angle = 0
11781186xanchor = "center"
@@ -1236,7 +1244,7 @@ def _build_subplot_title_annotations(
12361244"yref" :"paper" ,
12371245"text" :subplot_titles [index ],
12381246"showarrow" :False ,
1239- "font" :dict ( size = 16 ) ,
1247+ "font" :font ,
12401248"xanchor" :xanchor ,
12411249"yanchor" :yanchor ,
12421250 }