对于一个不错的图像()类型的情节,你需要添加一些标签到你的轴。此外,颜色图例将有助于解释颜色。我的博客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