對於一個不錯的圖像()類型的情節,你需要添加一些標籤到你的軸。此外,顏色圖例將有助於解釋顏色。我的博客http://menugget.blogspot.de/具有將此比例添加到圖像繪圖的功能。下面是一個例子(從menugget加載image.scale功能後:
years <- seq(1975,1989,2)
db <- data.frame(Dallas=c(25, 28, 27, 29, 31, 33, 35, 37),
Houston=c(33, 38, 43, 48, 53, 58, 63, 68),
Lubbock=c(28, 29, 31, 33, 35, 37, 39, 41),
Austin= c(22, 24, 26, 28, 30, 32, 34, 36),
San_Antonio= c(31, 32, 33, 34, 35, 36, 37, 38)
)
db <- as.matrix(db)
#plot
layout(matrix(c(1,2), nrow=1, ncol=2), widths=c(4,1), heights=c(4))
layout.show(2)
par(mar=c(5,5,1,1))
image(x=years, z=db, yaxt="n")
axis(2, at=seq(0,1,,dim(db)[2]), labels=colnames(db))
#image.scale from http://menugget.blogspot.de/2011/08/adding-scale-to-image-plot.html
par(mar=c(5,0,1,5))
image.scale(db, horiz=FALSE, yaxt="n", xaxt="n", xlab="", ylab="")
axis(4)
mtext("temp", side=4, line=2)
box()
參見以下鏈接:http://stackoverflow.com/questions/7747991/geographical-heat-map-in -r http://stackoverflow.com/questions/8421536/a-true-heat-map-in-r http://stackoverflow.com/questions/10198228/heat-map-or-density-map-in-r http://stackoverflow.com/questions/8161014/custom-heat-map-in-r。這只是在SO搜索'[r]熱圖時的第幾個' – 2012-04-17 20:17:50
@PaulHiemstra看起來像一個重複的,那麼 - 答案在這些問題上是稀疏的,但它看起來像所有的信息在那裏,對嗎? – 2012-04-17 20:23:52
可能重複[繪圖a上或下三角矩陣的熱圖](http://stackoverflow.com/questions/6883618/plotting-a-heat-map-for-an-upper-or-lower-triangular-matrix) – 2012-04-17 20:28:46