@@ -44,22 +44,18 @@ def bbox_artist(*args, **kwargs):
44
44
if DEBUG :
45
45
mbbox_artist (* args , ** kwargs )
46
46
47
- # _get_packed_offsets() and _get_aligned_offsets() are coded assuming
48
- # that we are packing boxes horizontally. But same function will be
49
- # used with vertical packing.
50
-
51
47
52
48
def _get_packed_offsets (wd_list , total , sep , mode = "fixed" ):
53
- """
54
- Given a list of (width, xdescent) of each boxes, calculate the
55
- total width and the x-offset positions of each items according to
56
- *mode*. xdescent is analogous to the usual descent, but along the
57
- x-direction. xdescent values are currently ignored.
49
+ r"""
50
+ Pack boxes specified by their ``(width, xdescent)`` pair.
58
51
59
52
For simplicity of the description, the terminology used here assumes a
60
53
horizontal layout, but the function works equally for a vertical layout.
61
54
62
- There are three packing modes:
55
+ *xdescent* is analogous to the usual descent, but along the x-direction; it
56
+ is currently ignored.
57
+
58
+ There are three packing *mode*\s:
63
59
64
60
- 'fixed': The elements are packed tight to the left with a spacing of
65
61
*sep* in between. If *total* is *None* the returned total will be the
@@ -136,21 +132,31 @@ def _get_packed_offsets(wd_list, total, sep, mode="fixed"):
136
132
137
133
def _get_aligned_offsets (hd_list , height , align = "baseline" ):
138
134
"""
139
- Given a list of (height, descent) of each boxes, align the boxes
140
- with *align* and calculate the y-offsets of each boxes.
141
- total width and the offset positions of each items according to
142
- *mode*. xdescent is analogous to the usual descent , but along the
143
- x-direction. xdescent values are currently ignored .
135
+ Align boxes each specified by their `` (height, descent)`` pair.
136
+
137
+ For simplicity of the description, the terminology used here assumes a
138
+ horizontal layout (i.e., vertical alignment) , but the function works
139
+ equally for a vertical layout .
144
140
145
141
Parameters
146
142
----------
147
143
hd_list
148
144
List of (height, xdescent) of boxes to be aligned.
149
145
height : float or None
150
- Intended total length . If None, the maximum of the heights in *hd_list*
146
+ Intended total height . If None, the maximum of the heights in *hd_list*
151
147
is used.
152
148
align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
153
- Align mode.
149
+ The alignment anchor of the boxes.
150
+
151
+ Returns
152
+ -------
153
+ height
154
+ The total height of the packing (if a value was originally passed in,
155
+ it is returned without checking that it is actually large enough).
156
+ descent
157
+ The descent of the packing.
158
+ offsets
159
+ The bottom offsets of the boxes.
154
160
"""
155
161
156
162
if height is None :
0 commit comments