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.
ヒストグラムを作成すると、次のようになります。
set.seed(1) x <- 1:100 y <- x + rnorm(50) y=round(y) hist(y)
ヒストグラムをこのように少し見せる方法はありますか? プロットには必要のないビンを含むヒストグラムしか取得できません。
黒いビンは必要ありません。実際には、青、緑、赤の線だけが必要です。スタックオーバーフローは私を正しい方向に向けることができますか?
ヒストグラムをオブジェクトに配置し、type="s"を使用して段階的なプロットを取得します。
x <- rnorm(1000) y <- hist(x) plot(y$breaks, c(y$counts,0) ,type="s",col="blue")
与える: