所以我想我知道这个问题的答案,但我一直在尝试确认,但我在任何地方都找不到这样做的文档。我的问题是,包含geom_jitter是否会影响geom_smooth的结果。我假设它不会,因为如果它这样做了,它就没有太大的意义,但希望得到确认。
发布于 2021-02-26 06:18:08
视觉确认抖动不会影响平滑,但会改变比例的限制。请注意,平滑静止的角与矩形对齐。
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
geom_smooth() +
annotate("rect", xmin = 1.51, xmax = 5.42, ymin = 8, ymax = 36,
fill = NA, color = "black") +
coord_fixed(ratio = 1/15)

ggplot(mtcars, aes(wt, mpg)) +
geom_jitter(width = 5, height = 40) + # extreme jittering!
geom_smooth() +
annotate("rect", xmin = 1.51, xmax = 5.42, ymin = 8, ymax = 36,
fill = NA, color = "black") +
coord_fixed(ratio = 1/15)

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