Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 geom_jitter 绘制散点图,但想在 y 轴上设置限制(最小值 = 0)。有没有办法让点像往常一样“抖动”,但告诉他们不要低于 y=0?
不要censor越界 ( oob) 点(这是默认值),而是squish按您的比例,如下所示:
censor
oob
squish
test <- data.frame(x = mtcars$mpg, y = 0) ggplot(test, aes(x, y)) + geom_jitter() + scale_y_continuous(limits = c(0, 0.4), oob = scales::squish)