2
2
Container classes for `.Artist`\s.
3
3
4
4
`OffsetBox`
5
- The base of all container artists.
5
+ The base of all container artists defined in this module .
6
6
7
7
`AnchoredOffsetbox`, `AnchoredText`
8
8
Anchor and align an arbitrary `.Artist` or a text relative to the parent
16
16
Containers for layouting their children vertically or horizontally.
17
17
18
18
`PaddedBox`
19
- A container for add a padding around an `.Artist`.
19
+ A container to add a padding around an `.Artist`.
20
20
21
21
`TextArea`
22
22
Contains a single `.Text` instance.
23
-
24
23
"""
25
24
26
25
import numpy as np
@@ -396,8 +395,8 @@ def __init__(self, pad=None, sep=None, width=None, height=None,
396
395
397
396
Notes
398
397
-----
399
- *pad* and *sep* need to be given in points and will be scaled with
400
- the renderer dpi, while *width* and *height* need to be in pixels.
398
+ *pad* and *sep* are in points and will be scaled with the renderer
399
+ dpi, while *width* and *height* are in in pixels.
401
400
"""
402
401
super ().__init__ ()
403
402
@@ -449,8 +448,8 @@ def __init__(self, pad=None, sep=None, width=None, height=None,
449
448
450
449
Notes
451
450
-----
452
- *pad* and *sep* need to be given in points and will be scaled with
453
- the renderer dpi, while *width* and *height* need to be in pixels.
451
+ *pad* and *sep* are in points and will be scaled with the renderer
452
+ dpi, while *width* and *height* are in in pixels.
454
453
"""
455
454
super ().__init__ (pad , sep , width , height , align , mode , children )
456
455
@@ -527,8 +526,8 @@ def __init__(self, pad=None, sep=None, width=None, height=None,
527
526
528
527
Notes
529
528
-----
530
- *pad* and *sep* need to be given in points and will be scaled with
531
- the renderer dpi, while *width* and *height* need to be in pixels.
529
+ *pad* and *sep* are in points and will be scaled with the renderer
530
+ dpi, while *width* and *height* are in in pixels.
532
531
"""
533
532
super ().__init__ (pad , sep , width , height , align , mode , children )
534
533
@@ -1012,12 +1011,12 @@ def draw(self, renderer):
1012
1011
1013
1012
class AnchoredOffsetbox (OffsetBox ):
1014
1013
"""
1015
- A container of an `.OffsetBox` placing it according to location *loc*.
1014
+ An offset box placed according to location *loc*.
1016
1015
1017
- AnchoredOffsetbox has a single child. When multiple children
1018
- is needed, use other OffsetBox class to enclose them. By default,
1019
- the offset box is anchored against its parent axes. You may
1020
- explicitly specify the bbox_to_anchor.
1016
+ AnchoredOffsetbox has a single child. When multiple children are needed,
1017
+ use an extra OffsetBox to enclose them. By default, the offset box is
1018
+ anchored against its parent axes. You may explicitly specify the
1019
+ * bbox_to_anchor* .
1021
1020
"""
1022
1021
zorder = 5 # zorder of the legend
1023
1022
@@ -1044,27 +1043,20 @@ def __init__(self, loc,
1044
1043
Parameters
1045
1044
----------
1046
1045
loc : str
1047
- The box location.
1048
-
1049
- For back-compatibility, ``'center right'`` (but no other location)
1050
- can also be spelled ``'right'``, and each "string" locations can
1051
- also be given as a numeric value:
1052
-
1053
- =============== =============
1054
- Location String Location Code
1055
- =============== =============
1056
- 'best' 0
1057
- 'upper right' 1
1058
- 'upper left' 2
1059
- 'lower left' 3
1060
- 'lower right' 4
1061
- 'right' 5
1062
- 'center left' 6
1063
- 'center right' 7
1064
- 'lower center' 8
1065
- 'upper center' 9
1066
- 'center' 10
1067
- =============== =============
1046
+ The box location. Supported values:
1047
+
1048
+ - 'upper right'
1049
+ - 'upper left'
1050
+ - 'lower left'
1051
+ - 'lower right'
1052
+ - 'center left'
1053
+ - 'center right'
1054
+ - 'lower center'
1055
+ - 'upper center'
1056
+ - 'center'
1057
+
1058
+ For backward compatibility, numeric values are accepted as well.
1059
+ See the parameter *loc* of `.Legend` for details.
1068
1060
1069
1061
pad : float, default: 0.4
1070
1062
Padding around the child as fraction of the fontsize.
@@ -1279,9 +1271,6 @@ def _get_anchored_bbox(self, loc, bbox, parentbbox, borderpad):
1279
1271
class AnchoredText (AnchoredOffsetbox ):
1280
1272
"""
1281
1273
AnchoredOffsetbox with Text.
1282
-
1283
- This is a convenience class. Technically, it is just an `AnchoredOffsetbox`
1284
- containing a `TextArea`.
1285
1274
"""
1286
1275
1287
1276
def __init__ (self , s , loc , pad = 0.4 , borderpad = 0.5 , prop = None , ** kwargs ):
0 commit comments