@@ -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
+ Horizontally pack boxes specified by their ``(width, xdescent)`` pair.
58
51
59
- For simplicity of the description, the terminology used here assumes a
60
- horizontal layout, but the function works equally for a vertical layout.
52
+ ( For simplicity of the description, the terminology used here assumes a
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,30 @@ 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
+ Vertically 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, but the function works equally for a vertical layout.)
144
139
145
140
Parameters
146
141
----------
147
142
hd_list
148
143
List of (height, xdescent) of boxes to be aligned.
149
144
height : float or None
150
- Intended total length . If None, the maximum of the heights in *hd_list*
145
+ Intended total height . If None, the maximum of the heights in *hd_list*
151
146
is used.
152
147
align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
153
- Align mode.
148
+ The alignment anchor of the boxes.
149
+
150
+ Returns
151
+ -------
152
+ height
153
+ The total height of the packing (if a value was originally passed in,
154
+ it is returned without checking that it is actually large enough).
155
+ descent
156
+ The descent of the packing.
157
+ offsets
158
+ The bottom offsets of the boxes.
154
159
"""
155
160
156
161
if height is None :
0 commit comments