@@ -112,6 +112,19 @@ def substring_not_in_axes(substring, ax):
112
112
return all (check )
113
113
114
114
115
+ def property_in_axes_text (property , property_str , target_txt , ax ):
116
+ """
117
+ Return True if the specified text in an axes
118
+ has the property assigned to property_str
119
+ """
120
+ alltxt = ax .findobj (mpl .text .Text )
121
+ check = []
122
+ for t in alltxt :
123
+ if t .get_text () == target_txt :
124
+ check .append (plt .getp (t , property ) == property_str )
125
+ return all (check )
126
+
127
+
115
128
def easy_array (shape , start = 0 , stop = 1 ):
116
129
"""
117
130
Make an array with desired shape using np.linspace
@@ -2260,6 +2273,18 @@ def setUp(self):
2260
2273
2261
2274
self .darray = darray
2262
2275
2276
+ def test_title_kwargs (self ):
2277
+ g = xplt .FacetGrid (self .darray , col = "col" , row = "row" )
2278
+ g .set_titles (template = "{value}" , weight = "bold" )
2279
+
2280
+ # Rightmost column titles should be bold
2281
+ for label , ax in zip (self .darray .coords ["row" ].values , g .axes [:, - 1 ]):
2282
+ assert property_in_axes_text ("weight" , "bold" , label , ax )
2283
+
2284
+ # Top row titles should be bold
2285
+ for label , ax in zip (self .darray .coords ["col" ].values , g .axes [0 , :]):
2286
+ assert property_in_axes_text ("weight" , "bold" , label , ax )
2287
+
2263
2288
@pytest .mark .slow
2264
2289
def test_default_labels (self ):
2265
2290
g = xplt .FacetGrid (self .darray , col = "col" , row = "row" )
0 commit comments