@@ -232,7 +232,7 @@ class AnchoredSizeBar(AnchoredOffsetbox):
232
232
def __init__ (self , transform , size , label , loc ,
233
233
pad = 0.1 , borderpad = 0.1 , sep = 2 ,
234
234
frameon = True , size_vertical = 0 , color = 'black' ,
235
- label_top = False , fontproperties = None , fill_bar = False ,
235
+ label_top = False , fontproperties = None , fill_bar = None ,
236
236
** kwargs ):
237
237
"""
238
238
Draw a horizontal scale bar with a center-aligned label underneath.
@@ -298,7 +298,8 @@ def __init__(self, transform, size, label, loc,
298
298
fill_bar : bool, optional
299
299
If True and if size_vertical is nonzero, the size bar will
300
300
be filled in with the color specified by the size bar.
301
- Defaults to False.
301
+ Defaults to True if `size_vertical` is greater than
302
+ zero and False otherwise.
302
303
303
304
**kwargs :
304
305
Keyworded arguments to pass to
@@ -339,6 +340,9 @@ def __init__(self, transform, size, label, loc,
339
340
size_vertical=0.5, color='white', \
340
341
fontproperties=fontprops)
341
342
"""
343
+ if fill_bar is None :
344
+ fill_bar = size_vertical > 0
345
+
342
346
self .size_bar = AuxTransformBox (transform )
343
347
self .size_bar .add_artist (Rectangle ((0 , 0 ), size , size_vertical ,
344
348
fill = fill_bar , facecolor = color ,
0 commit comments