ヒストグラムの上にヒストグラムの境界線をオーバーレイしたいのですが、正しい場所にありません
library(tidyverse) data("iris") iris %>% ggplot( aes(Sepal.Length) ) + geom_histogram( alpha = .5 ) + stat_bin(geom="step") + facet_wrap( ~Species, ncol = 1 )
戻り値
境界線をヒストグラムに合わせるにはどうすればよいですか?
を指定しbinwidthてから設定することで実行できます。breaks
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]
クリックしてQRコードを生成します
コメントを追加