对于一个漂亮的 image() 类型的绘图,您需要在轴上添加一些标签。此外,颜色图例将有助于解释颜色。我的博客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()