Skip to content

Commit fcd4ea3

Browse files
committed
Document removal of to_layer/from_geom/from_stat in changelog
1 parent aee8001 commit fcd4ea3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/changelog.qmd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ title: Changelog
3838
theme(plot_footer_line=element_line(color="black"))
3939
```
4040

41+
### API Changes
42+
43+
- Removed `geom.to_layer()`, `stat.to_layer()`, `annotate.to_layer()`,
44+
`layer.from_geom()` and `layer.from_stat()`. Use
45+
`layer(geom=...)` and `layer(stat=...)` directly.
46+
47+
The [](:class:`~plotnine.layer.layer`) constructor now handles both geom-first
48+
and stat-first creation. When only a `stat` is provided, the geom is
49+
automatically derived from the stat's default.
50+
51+
```python
52+
# Before
53+
layer.from_geom(geom_point())
54+
layer.from_stat(stat_bin())
55+
geom_point().to_layer()
56+
57+
# After
58+
layer(geom=geom_point())
59+
layer(stat=stat_bin())
60+
layer(geom=geom_point())
61+
```
62+
4163
### Bug Fixes
4264

4365
- Fixed [](:class:`~plotnine.geom_smooth`) / [](:class:`~plotnine.stat_smooth`) when using a linear model via "lm" with weights for the model to do a weighted regression. This bug did not affect the formula API of the linear model. ({{< issue 1005 >}})

0 commit comments

Comments
 (0)