plotnine 0.15.0a6__py3-none-any.whl → 0.15.0a8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plotnine/_mpl/layout_manager/_engine.py +2 -2
- plotnine/_mpl/layout_manager/_layout_items.py +6 -2
- plotnine/_mpl/layout_manager/_layout_tree.py +219 -58
- plotnine/_mpl/layout_manager/_spaces.py +98 -28
- plotnine/_mpl/text.py +1 -7
- plotnine/composition/__init__.py +2 -2
- plotnine/composition/_beside.py +12 -4
- plotnine/composition/{_arrange.py → _compose.py} +118 -38
- plotnine/composition/_plot_spacer.py +6 -0
- plotnine/composition/_stack.py +12 -4
- plotnine/geoms/geom_bar.py +1 -0
- plotnine/geoms/geom_bin_2d.py +4 -0
- plotnine/geoms/geom_boxplot.py +4 -0
- plotnine/geoms/geom_count.py +4 -0
- plotnine/geoms/geom_density_2d.py +4 -0
- plotnine/geoms/geom_dotplot.py +1 -1
- plotnine/geoms/geom_histogram.py +1 -1
- plotnine/geoms/geom_pointdensity.py +4 -0
- plotnine/geoms/geom_qq.py +4 -0
- plotnine/geoms/geom_qq_line.py +4 -0
- plotnine/geoms/geom_quantile.py +4 -0
- plotnine/geoms/geom_sina.py +1 -1
- plotnine/geoms/geom_smooth.py +4 -0
- plotnine/geoms/geom_violin.py +4 -0
- plotnine/ggplot.py +4 -4
- plotnine/stats/stat_bin.py +4 -0
- plotnine/stats/stat_bin_2d.py +4 -0
- plotnine/stats/stat_bindot.py +1 -0
- plotnine/stats/stat_boxplot.py +1 -1
- plotnine/stats/stat_count.py +1 -0
- plotnine/stats/stat_density.py +1 -1
- plotnine/stats/stat_density_2d.py +1 -0
- plotnine/stats/stat_ecdf.py +1 -1
- plotnine/stats/stat_ellipse.py +4 -0
- plotnine/stats/stat_function.py +4 -0
- plotnine/stats/stat_hull.py +4 -0
- plotnine/stats/stat_identity.py +4 -0
- plotnine/stats/stat_pointdensity.py +1 -0
- plotnine/stats/stat_qq.py +1 -0
- plotnine/stats/stat_qq_line.py +1 -0
- plotnine/stats/stat_quantile.py +1 -1
- plotnine/stats/stat_sina.py +1 -1
- plotnine/stats/stat_smooth.py +1 -0
- plotnine/stats/stat_sum.py +4 -0
- plotnine/stats/stat_summary.py +1 -1
- plotnine/stats/stat_summary_bin.py +1 -1
- plotnine/stats/stat_unique.py +4 -0
- plotnine/stats/stat_ydensity.py +1 -1
- plotnine/themes/theme.py +1 -1
- plotnine/themes/theme_void.py +1 -7
- {plotnine-0.15.0a6.dist-info → plotnine-0.15.0a8.dist-info}/METADATA +1 -1
- {plotnine-0.15.0a6.dist-info → plotnine-0.15.0a8.dist-info}/RECORD +55 -55
- {plotnine-0.15.0a6.dist-info → plotnine-0.15.0a8.dist-info}/WHEEL +0 -0
- {plotnine-0.15.0a6.dist-info → plotnine-0.15.0a8.dist-info}/licenses/LICENSE +0 -0
- {plotnine-0.15.0a6.dist-info → plotnine-0.15.0a8.dist-info}/top_level.txt +0 -0
plotnine/composition/_stack.py
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from dataclasses import dataclass
|
|
3
4
|
from typing import TYPE_CHECKING
|
|
4
5
|
|
|
5
|
-
from .
|
|
6
|
+
from ._compose import Compose
|
|
6
7
|
|
|
7
8
|
if TYPE_CHECKING:
|
|
8
9
|
from plotnine.ggplot import ggplot
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
@dataclass
|
|
13
|
+
class Stack(Compose):
|
|
12
14
|
"""
|
|
13
15
|
Place plots or compositions on top of each other
|
|
14
16
|
|
|
@@ -20,6 +22,12 @@ class Stack(Arrange):
|
|
|
20
22
|
composition / composition
|
|
21
23
|
|
|
22
24
|
Typically, you will use this class through the `/` operator.
|
|
25
|
+
|
|
26
|
+
See Also
|
|
27
|
+
--------
|
|
28
|
+
plotnine.composition.Beside : To arrange plots side by side
|
|
29
|
+
plotnine.composition.plot_spacer : To add a blank space between plots
|
|
30
|
+
plotnine.composition.Compose : For more on composing plots
|
|
23
31
|
"""
|
|
24
32
|
|
|
25
33
|
@property
|
|
@@ -30,7 +38,7 @@ class Stack(Arrange):
|
|
|
30
38
|
def ncol(self) -> int:
|
|
31
39
|
return 1
|
|
32
40
|
|
|
33
|
-
def __truediv__(self, rhs: ggplot |
|
|
41
|
+
def __truediv__(self, rhs: ggplot | Compose) -> Compose:
|
|
34
42
|
"""
|
|
35
43
|
Add rhs as a row
|
|
36
44
|
"""
|
|
@@ -38,7 +46,7 @@ class Stack(Arrange):
|
|
|
38
46
|
# operands into a single operation
|
|
39
47
|
return Stack([*self, rhs])
|
|
40
48
|
|
|
41
|
-
def __or__(self, rhs: ggplot |
|
|
49
|
+
def __or__(self, rhs: ggplot | Compose) -> Compose:
|
|
42
50
|
"""
|
|
43
51
|
Add rhs as a column
|
|
44
52
|
"""
|
plotnine/geoms/geom_bar.py
CHANGED
plotnine/geoms/geom_bin_2d.py
CHANGED
|
@@ -17,6 +17,10 @@ class geom_bin_2d(geom_rect):
|
|
|
17
17
|
Parameters
|
|
18
18
|
----------
|
|
19
19
|
{common_parameters}
|
|
20
|
+
|
|
21
|
+
See Also
|
|
22
|
+
--------
|
|
23
|
+
plotnine.stat_bin_2d : The default stat for this `geom`.
|
|
20
24
|
"""
|
|
21
25
|
|
|
22
26
|
DEFAULT_PARAMS = {"stat": "bin_2d", "position": "identity", "na_rm": False}
|
plotnine/geoms/geom_boxplot.py
CHANGED
|
@@ -70,6 +70,10 @@ class geom_boxplot(geom):
|
|
|
70
70
|
fatten : float, default=2
|
|
71
71
|
A multiplicative factor used to increase the size of the
|
|
72
72
|
middle bar across the box.
|
|
73
|
+
|
|
74
|
+
See Also
|
|
75
|
+
--------
|
|
76
|
+
plotnine.stat_boxplot : The default `stat` for this `geom`.
|
|
73
77
|
"""
|
|
74
78
|
|
|
75
79
|
DEFAULT_AES = {
|
plotnine/geoms/geom_count.py
CHANGED
plotnine/geoms/geom_dotplot.py
CHANGED
plotnine/geoms/geom_histogram.py
CHANGED
plotnine/geoms/geom_qq.py
CHANGED
plotnine/geoms/geom_qq_line.py
CHANGED
plotnine/geoms/geom_quantile.py
CHANGED
|
@@ -16,6 +16,10 @@ class geom_quantile(geom_path):
|
|
|
16
16
|
Line end style. This option is applied for solid linetypes.
|
|
17
17
|
linejoin : Literal["round", "miter", "bevel"], default="round"
|
|
18
18
|
Line join style. This option is applied for solid linetypes.
|
|
19
|
+
|
|
20
|
+
See Also
|
|
21
|
+
--------
|
|
22
|
+
plotnine.stat_quantile : The default `stat` for this `geom`.
|
|
19
23
|
"""
|
|
20
24
|
|
|
21
25
|
DEFAULT_AES = {
|
plotnine/geoms/geom_sina.py
CHANGED
plotnine/geoms/geom_smooth.py
CHANGED
|
@@ -34,6 +34,10 @@ class geom_smooth(geom):
|
|
|
34
34
|
How much (vertically) of the legend box should be filled by
|
|
35
35
|
the color that indicates the confidence intervals. Should be
|
|
36
36
|
in the range [0, 1].
|
|
37
|
+
|
|
38
|
+
See Also
|
|
39
|
+
--------
|
|
40
|
+
plotnine.stat_smooth : The default `stat` for this `geom`.
|
|
37
41
|
"""
|
|
38
42
|
|
|
39
43
|
DEFAULT_AES = {
|
plotnine/geoms/geom_violin.py
CHANGED
|
@@ -45,6 +45,10 @@ class geom_violin(geom):
|
|
|
45
45
|
'left-right' # Alternate (left first) half violins by the group
|
|
46
46
|
'right-left' # Alternate (right first) half violins by the group
|
|
47
47
|
```
|
|
48
|
+
|
|
49
|
+
See Also
|
|
50
|
+
--------
|
|
51
|
+
plotnine.stat_ydensity : The default `stat` for this `geom`.
|
|
48
52
|
"""
|
|
49
53
|
|
|
50
54
|
DEFAULT_AES = {
|
plotnine/ggplot.py
CHANGED
|
@@ -52,7 +52,7 @@ if TYPE_CHECKING:
|
|
|
52
52
|
|
|
53
53
|
from plotnine import watermark
|
|
54
54
|
from plotnine._mpl.gridspec import p9GridSpec
|
|
55
|
-
from plotnine.composition import
|
|
55
|
+
from plotnine.composition import Compose
|
|
56
56
|
from plotnine.coords.coord import coord
|
|
57
57
|
from plotnine.facets.facet import facet
|
|
58
58
|
from plotnine.layer import layer
|
|
@@ -245,7 +245,7 @@ class ggplot:
|
|
|
245
245
|
self = deepcopy(self)
|
|
246
246
|
return self.__iadd__(rhs)
|
|
247
247
|
|
|
248
|
-
def __or__(self, rhs: ggplot |
|
|
248
|
+
def __or__(self, rhs: ggplot | Compose) -> Compose:
|
|
249
249
|
"""
|
|
250
250
|
Compose 2 plots columnwise
|
|
251
251
|
"""
|
|
@@ -253,7 +253,7 @@ class ggplot:
|
|
|
253
253
|
|
|
254
254
|
return Beside([self, rhs])
|
|
255
255
|
|
|
256
|
-
def __truediv__(self, rhs: ggplot |
|
|
256
|
+
def __truediv__(self, rhs: ggplot | Compose) -> Compose:
|
|
257
257
|
"""
|
|
258
258
|
Compose 2 plots rowwise
|
|
259
259
|
"""
|
|
@@ -261,7 +261,7 @@ class ggplot:
|
|
|
261
261
|
|
|
262
262
|
return Stack([self, rhs])
|
|
263
263
|
|
|
264
|
-
def __sub__(self, rhs: ggplot |
|
|
264
|
+
def __sub__(self, rhs: ggplot | Compose) -> Compose:
|
|
265
265
|
"""
|
|
266
266
|
Compose 2 plots columnwise
|
|
267
267
|
"""
|
plotnine/stats/stat_bin.py
CHANGED
|
@@ -53,6 +53,10 @@ class stat_bin(stat):
|
|
|
53
53
|
pad : bool, default=False
|
|
54
54
|
If `True`{.py}, adds empty bins at either side of x.
|
|
55
55
|
This ensures that frequency polygons touch 0.
|
|
56
|
+
|
|
57
|
+
See Also
|
|
58
|
+
--------
|
|
59
|
+
plotnine.histogram : The default `geom` for this `stat`.
|
|
56
60
|
"""
|
|
57
61
|
|
|
58
62
|
_aesthetics_doc = """
|
plotnine/stats/stat_bin_2d.py
CHANGED
|
@@ -35,6 +35,10 @@ class stat_bin_2d(stat):
|
|
|
35
35
|
the stories in your data.
|
|
36
36
|
drop : bool, default=False
|
|
37
37
|
If `True`{.py}, removes all cells with zero counts.
|
|
38
|
+
|
|
39
|
+
See Also
|
|
40
|
+
--------
|
|
41
|
+
plotnine.geom_rect : The default `geom` for this `stat`.
|
|
38
42
|
"""
|
|
39
43
|
|
|
40
44
|
_aesthetics_doc = """
|
plotnine/stats/stat_bindot.py
CHANGED
plotnine/stats/stat_boxplot.py
CHANGED
plotnine/stats/stat_count.py
CHANGED
plotnine/stats/stat_density.py
CHANGED
plotnine/stats/stat_ecdf.py
CHANGED
plotnine/stats/stat_ellipse.py
CHANGED
|
@@ -37,6 +37,10 @@ class stat_ellipse(stat):
|
|
|
37
37
|
The confidence level at which to draw the ellipse.
|
|
38
38
|
segments : int, default=51
|
|
39
39
|
Number of segments to be used in drawing the ellipse.
|
|
40
|
+
|
|
41
|
+
See Also
|
|
42
|
+
--------
|
|
43
|
+
plotnine.geom_path : The default `geom` for this `stat`.
|
|
40
44
|
"""
|
|
41
45
|
|
|
42
46
|
REQUIRED_AES = {"x", "y"}
|
plotnine/stats/stat_function.py
CHANGED
|
@@ -37,6 +37,10 @@ class stat_function(stat):
|
|
|
37
37
|
then the `xlim` must be provided.
|
|
38
38
|
args : Optional[tuple[Any] | dict[str, Any]], default=None
|
|
39
39
|
Arguments to pass to `fun`.
|
|
40
|
+
|
|
41
|
+
See Also
|
|
42
|
+
--------
|
|
43
|
+
plotnine.geom_path : The default `geom` for this `stat`.
|
|
40
44
|
"""
|
|
41
45
|
|
|
42
46
|
_aesthetics_doc = """
|
plotnine/stats/stat_hull.py
CHANGED
|
@@ -26,6 +26,10 @@ class stat_hull(stat):
|
|
|
26
26
|
Raised when Qhull encounters an error condition,
|
|
27
27
|
such as geometrical degeneracy when options to resolve are
|
|
28
28
|
not enabled.
|
|
29
|
+
|
|
30
|
+
See Also
|
|
31
|
+
--------
|
|
32
|
+
plotnine.geom_path : The default `geom` for this `stat`.
|
|
29
33
|
"""
|
|
30
34
|
|
|
31
35
|
_aesthetics_doc = """
|
plotnine/stats/stat_identity.py
CHANGED
plotnine/stats/stat_qq.py
CHANGED
plotnine/stats/stat_qq_line.py
CHANGED
plotnine/stats/stat_quantile.py
CHANGED
plotnine/stats/stat_sina.py
CHANGED
plotnine/stats/stat_smooth.py
CHANGED
plotnine/stats/stat_sum.py
CHANGED
plotnine/stats/stat_summary.py
CHANGED
plotnine/stats/stat_unique.py
CHANGED
plotnine/stats/stat_ydensity.py
CHANGED
plotnine/themes/theme.py
CHANGED
plotnine/themes/theme_void.py
CHANGED
|
@@ -25,7 +25,6 @@ class theme_void(theme):
|
|
|
25
25
|
|
|
26
26
|
def __init__(self, base_size=11, base_family=None):
|
|
27
27
|
base_family = base_family or get_option("base_family")
|
|
28
|
-
half_line = base_size / 2
|
|
29
28
|
m = get_option("base_margin")
|
|
30
29
|
# Use only inherited elements and make everything blank
|
|
31
30
|
theme.__init__(
|
|
@@ -98,11 +97,6 @@ class theme_void(theme):
|
|
|
98
97
|
plot_tag_location="margin",
|
|
99
98
|
plot_tag_position="topleft",
|
|
100
99
|
strip_align=0,
|
|
101
|
-
strip_text=element_text(
|
|
102
|
-
color="#1A1A1A",
|
|
103
|
-
size=base_size * 0.8,
|
|
104
|
-
linespacing=1.5,
|
|
105
|
-
margin=margin_auto(half_line * 0.8),
|
|
106
|
-
),
|
|
100
|
+
strip_text=element_text(size=base_size * 0.8),
|
|
107
101
|
complete=True,
|
|
108
102
|
)
|