@@ -741,7 +741,7 @@ def make_subplots(rows=1, cols=1,
741
741
try :
742
742
subplot_titles = kwargs ['subplot_titles' ]
743
743
except KeyError :
744
- subplot_titles = ["" ] * rows * cols
744
+ subplot_titles = []
745
745
746
746
# Sanitize 'specs' (must be a list of lists)
747
747
exception_msg = "Keyword argument 'specs' must be a list of lists"
@@ -1143,32 +1143,35 @@ def _pad(s, cell_len=cell_len):
1143
1143
)
1144
1144
1145
1145
# Add subplot titles
1146
- x_dom = list_of_domains [::2 ]
1147
- y_dom = list_of_domains [1 ::2 ]
1148
-
1149
- subtitle_pos_x = []
1150
- for index in range (len (x_dom )):
1151
- subtitle_pos_x .append (((x_dom [index ][1 ])- (x_dom [index ][0 ]))/ 2 +
1152
- x_dom [index ][0 ])
1153
-
1154
- subtitle_pos_y = []
1155
- for index in range (len (y_dom )):
1156
- subtitle_pos_y .append (y_dom [index ][1 ])
1157
-
1158
- plot_titles = []
1159
- for index in range (len (x_dom )):
1160
- plot_titles .append ({'y' : subtitle_pos_y [index ],
1161
- 'xref' : 'paper' ,
1162
- 'x' : subtitle_pos_x [index ],
1163
- 'yref' : 'paper' ,
1164
- 'text' : subplot_titles [index ],
1165
- 'showarrow' : False ,
1166
- 'font' : Font (size = 18 ),
1167
- 'xanchor' : 'center' ,
1168
- 'yanchor' : 'bottom'
1169
- })
1170
-
1171
- layout ['annotations' ] = plot_titles
1146
+ if not subplot_titles :
1147
+ pass
1148
+ else :
1149
+ x_dom = list_of_domains [::2 ]
1150
+ y_dom = list_of_domains [1 ::2 ]
1151
+
1152
+ subtitle_pos_x = []
1153
+ for index in range (len (x_dom )):
1154
+ subtitle_pos_x .append (((x_dom [index ][1 ])- (x_dom [index ][0 ]))/ 2 +
1155
+ x_dom [index ][0 ])
1156
+
1157
+ subtitle_pos_y = []
1158
+ for index in range (len (y_dom )):
1159
+ subtitle_pos_y .append (y_dom [index ][1 ])
1160
+
1161
+ plot_titles = []
1162
+ for index in range (len (x_dom )):
1163
+ plot_titles .append ({'y' : subtitle_pos_y [index ],
1164
+ 'xref' : 'paper' ,
1165
+ 'x' : subtitle_pos_x [index ],
1166
+ 'yref' : 'paper' ,
1167
+ 'text' : subplot_titles [index ],
1168
+ 'showarrow' : False ,
1169
+ 'font' : Font (size = 18 ),
1170
+ 'xanchor' : 'center' ,
1171
+ 'yanchor' : 'bottom'
1172
+ })
1173
+
1174
+ layout ['annotations' ] = plot_titles
1172
1175
1173
1176
if print_grid :
1174
1177
print (grid_str )
0 commit comments