02.07.2013 Views

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

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

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

72 第五章 图库<br />

1 > # 用分类调色板<br />

2 > library(RColorBrewer)<br />

3 > par(mfrow = c(2, 1), mar = c(3, 2.5, 0.5, 0.1))<br />

4 > death = t(VADeaths)[, 5:1]<br />

5 > barplot(death, col = brewer.pal(4, "Set1"))<br />

6 > barplot(death, col = brewer.pal(4, "Set1"), beside = TRUE,<br />

7 + legend = TRUE)<br />

0 50 100 150 200<br />

0 10 20 30 40 50 60 70<br />

70-74 65-69 60-64 55-59 50-54<br />

Rural Male<br />

Rural Female<br />

Urban Male<br />

Urban Female<br />

70-74 65-69 60-64 55-59 50-54<br />

图 5.7: 弗吉尼亚死亡率数据条形图:堆砌和并列的条形图效果。

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

Saved successfully!

Ooh no, something went wrong!