现代统计图形 - 科学网—博客
现代统计图形 - 科学网—博客
现代统计图形 - 科学网—博客
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
60 第五章 图库<br />
1 > par(mfrow = c(2, 2), mar = c(2, 3, 2, 0.5), mgp = c(2,<br />
2 + 0.5, 0))<br />
3 > data(geyser, package = "MASS")<br />
4 > hist(geyser$waiting, main = "(1) freq = TRUE", xlab = "waiting")<br />
5 > hist(geyser$waiting, freq = FALSE, xlab = "waiting",<br />
6 + main = "(2) freq = FALSE")<br />
7 > hist(geyser$waiting, breaks = 5, density = 10, xlab = "waiting",<br />
8 + main = "(3) breaks = 5")<br />
9 > hist(geyser$waiting, breaks = 40, col = "red", xlab = "waiting",<br />
10 + main = "(4) breaks = 40")<br />
Frequency<br />
Frequency<br />
0 10 20 30 40 50 60<br />
0 20 40 60 80<br />
(1) freq = TRUE<br />
40 50 60 70 80 90 100 110<br />
waiting<br />
(3) breaks = 5<br />
40 50 60 70 80 90 100 110<br />
Density<br />
Frequency<br />
0.00 0.01 0.02 0.03 0.04<br />
0 5 10 15 20 25<br />
(2) freq = FALSE<br />
40 50 60 70 80 90 100 110<br />
waiting<br />
(4) breaks = 40<br />
40 50 60 70 80 90 100 110<br />
图 5.1: 喷泉间隔时间直方图:(1)使用默认参数值(作频数图);(2)概<br />
率密度直方图;(3)减小区间段数,直方图看起来更平滑(偏差大,方差<br />
小);(4)增大区间段数,直方图更突兀(偏差小,方差大)。