3.4. 区切幅を変えてみる
何分割するかを指定したい場合はbins
を、
区切り幅を指定したい場合はbinwidth
を指定します。
何分割するかを指定
# ggplot2 パッケージを使用 library(ggplot2) # ヒストグラムを描画 g <- ggplot(d) g <- g + geom_histogram( aes( x=d$"自チーム.10分あたりのTOUCH数", y=..density.. ), bins=45 ) g <- g + labs(title="10分あたりのボールタッチ回数") g <- g + xlab("ボールタッチ") g <- g + ylab("確率密度") print(g)
図 3-4-1
区切り幅を指定
# ggplot2 パッケージを使用 library(ggplot2) # ヒストグラムを描画 g <- ggplot(d) g <- g + geom_histogram( aes( x=d$"自チーム.10分あたりのTOUCH数", y=..density.. ), binwidth=5 ) # タイトルを変更 g <- g + labs(title="10分あたりのボールタッチ回数") g <- g + xlab("ボールタッチ") g <- g + ylab("確率密度") print(g)