如何为geom_smooth制作圆形线条?由于没有lineend参数,geom_smooth(lineend = "round")显然失败了。我也是徒劳无功的:
update_geom_defaults("smooth", list(lineend = "round"))因此,要么是有一些我不知道的简单选项,要么是lineend是硬编码的,因此需要想出一个自定义的geom_smooth函数,我不知道怎么做。
我不认为它需要MRE,但是:
library(ggplot2)
dat = data.frame(x = 1:3, y = 2:4)
ggplot(dat, aes(x, y)) + geom_smooth(size = 4) # increase size to discern lineends发布于 2020-09-28 22:17:03
这可以使用stat_smooth来实现
library(ggplot2)
dat = data.frame(x = 1:3, y = 2:4)
ggplot(dat, aes(x, y)) + stat_smooth(size = 4, geom = "line", lineend = "round", color = "blue")

https://stackoverflow.com/questions/64100639
复制相似问题