Skip to content

Commit fb9e67a

Browse files
committed
DOC: Describe the labs parameters
1 parent 9e8664d commit fb9e67a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

plotnine/labels.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
__all__ = ("xlab", "ylab", "labs", "ggtitle")
1313

1414

15+
# TODO: Make keyword-only when python>=3.10
16+
# i.e. @dataclass(kw_only=True)
1517
@dataclass
1618
class labs:
1719
"""
@@ -20,20 +22,73 @@ class labs:
2022

2123
# Names of Scaled Aesthetics
2224
x: str | None = None
25+
"""
26+
Name of the x-axis.
27+
"""
28+
2329
y: str | None = None
30+
"""
31+
Name of the y-axis.
32+
"""
33+
2434
alpha: str | None = None
35+
"""
36+
Name of the alpha legend.
37+
"""
38+
2539
color: str | None = None
40+
"""
41+
Name of the color legend or colorbar.
42+
"""
43+
2644
colour: str | None = None
45+
"""
46+
Name of the colour legend or colourbar.
47+
48+
This is an alias of the `color` parameter. Only use one of
49+
the spellings.
50+
"""
51+
2752
fill: str | None = None
53+
"""
54+
Name of the fill legend/colourbar.
55+
"""
56+
2857
linetype: str | None = None
58+
"""
59+
Name of the linetype legend.
60+
"""
61+
2962
shape: str | None = None
63+
"""
64+
Name of the shape legend.
65+
"""
66+
3067
size: str | None = None
68+
"""
69+
Name of the size legend.
70+
"""
71+
3172
stroke: str | None = None
73+
"""
74+
Name of the stroke legend.
75+
"""
3276

3377
# Other texts
3478
title: str | None = None
79+
"""
80+
The title of the plot.
81+
"""
82+
3583
subtitle: str | None = None
84+
"""
85+
The subtitle of the plot.
86+
"""
87+
3688
caption: str | None = None
89+
"""
90+
The caption at the bottom of the plot.
91+
"""
3792

3893
def __post_init__(self):
3994
kwargs: dict[str, str] = {

0 commit comments

Comments
 (0)