【发布时间】:2019-10-07 01:05:20
【问题描述】:
我看到geom_area 是如何用于填充直线下方的区域的。如何填充由geom_bspline 创建的曲线下的区域?
library("tidyverse")
library("ggforce")
dftest <- tibble(
x = c(1, 2, 3, 4, 5),
y = c(10, 15, 30, 80, 5)
)
# Fill area under straight lines - OK
ggplot(dftest, aes(x = x, y = y)) +
geom_point() +
geom_line() +
geom_area(alpha = 0.3)
# Fill area under curve ???
ggplot(dftest, aes(x = x, y = y)) +
geom_point() +
geom_bspline()
【问题讨论】: