画这种图,至少可以用下面两种方法吧,以数据VADeaths为例
<br />
VADsort = VADeaths[, names(sort(colSums(VADeaths), dec = T))]<br />
png("bar_1.png")<br />
barplot(VADsort, col = 1:5, legend = T)<br />
dev.off()</p>
<p>png("bar_2.png")<br />
barchart(t(VADsort), horizontal = FALSE, col = 1:5,<br />
key = list(space = "right", title = "age",<br />
text = list(colnames(t(VADsort))),<br />
rect = list(col = 1:5)))<br />
dev.off()<br />
</p>
[attachment=205516,342] [attachment=205516,343]