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_density_ridges()最上面的情节制作情节时,触摸面板的顶部。为了美学目的,我如何在那里创造一个小空白?
geom_density_ridges()
library(ggplot2) library(ggridges) ggplot(iris, aes(x = Sepal.Length, y = Species)) + geom_density_ridges()
这可以通过通过 的expand参数增加 y 尺度的扩展来实现scale_y_discrete:
expand
scale_y_discrete
library(ggplot2) library(ggridges) ggplot(iris, aes(x = Sepal.Length, y = Species)) + geom_density_ridges() + scale_y_discrete(expand = expansion(add = c(.3, 1.4))) #> Picking joint bandwidth of 0.181