02.07.2013 Views

现代统计图形 - 科学网—博客

现代统计图形 - 科学网—博客

现代统计图形 - 科学网—博客

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.15 矩阵图 99<br />

1 > sines = outer(1:20, 1:4, function(x, y) sin(x/20 *<br />

2 + pi * y))<br />

3 > par(mar = c(1, 4, 0.1, 0.1))<br />

4 > matplot(sines, type = "b", pch = 21:24, col = 2:5,<br />

5 + bg = 2:5)<br />

6 > # 数据矩阵的前6行<br />

7 > round(head(sines), 5)<br />

[,1] [,2] [,3] [,4]<br />

[1,] 0.1564 0.3090 0.4540 0.5878<br />

[2,] 0.3090 0.5878 0.8090 0.9511<br />

[3,] 0.4540 0.8090 0.9877 0.9511<br />

[4,] 0.5878 0.9511 0.9511 0.5878<br />

[5,] 0.7071 1.0000 0.7071 0.0000<br />

[6,] 0.8090 0.9511 0.3090 -0.5878<br />

-1.0 -0.5 0.0 0.5 1.0<br />

sines<br />

图 5.21: 用矩阵图画出的一系列正弦曲线:每条曲线都有不同的点线样式和<br />

颜色。

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!