@@ -67,6 +67,7 @@ class AnchoredSizeBar(AnchoredOffsetbox):
67
67
def __init__ (self , transform , size , label , loc ,
68
68
pad = 0.1 , borderpad = 0.1 , sep = 2 , prop = None ,
69
69
frameon = True , size_vertical = 0 , color = 'black' ,
70
+ label_top = False ,
70
71
** kwargs ):
71
72
"""
72
73
Draw a horizontal bar with the size in data coordinate of the give axes.
@@ -91,6 +92,8 @@ def __init__(self, transform, size, label, loc,
91
92
vertical length of the size bar, given in data coordinates
92
93
color : str, optional
93
94
color for the size bar and label
95
+ label_top : bool, optional
96
+ if true, the label will be over the rectangle
94
97
95
98
Example:
96
99
--------
@@ -110,7 +113,12 @@ def __init__(self, transform, size, label, loc,
110
113
111
114
self .txt_label = TextArea (label , minimumdescent = False )
112
115
113
- self ._box = VPacker (children = [self .size_bar , self .txt_label ],
116
+ if label_top :
117
+ _box_children = [self .txt_label , self .size_bar ]
118
+ else :
119
+ _box_children = [self .size_bar , self .txt_label ]
120
+
121
+ self ._box = VPacker (children = _box_children ,
114
122
align = "center" ,
115
123
pad = 0 , sep = sep )
116
124
0 commit comments