汤姆
我想在直方图上覆盖直方图边框,但是它们的位置不正确
library(tidyverse)
data("iris")
iris %>%
ggplot(
aes(Sepal.Length)
) +
geom_histogram(
alpha = .5
) +
stat_bin(geom="step") +
facet_wrap(
~Species, ncol = 1
)
退货
如何将边框与直方图对齐?
Mouad_Seridi
可以通过指定binwidth
,然后设置breaks
library(tidyverse)
data("iris")
iris %>%
ggplot( aes(Sepal.Length)) +
geom_histogram(alpha = .5, binwidth = .1) +
stat_bin(geom="step", breaks = seq(3,8, .1)) +
facet_wrap( ~Species, ncol = 1)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
编辑于
我来说两句