将相关矩阵绘制成图形

我有一个有一些相关值的矩阵。现在我想绘制一个图表看起来或多或少像这样:

我如何实现呢?

快,脏,在球场:

library(lattice)

#Build the horizontal and vertical axis information
hor <- c("214", "215", "216", "224", "211", "212", "213", "223", "226", "225")
ver <- paste("DM1-", hor, sep="")

#Build the fake correlation matrix
nrowcol <- length(ver)
cor <- matrix(runif(nrowcol*nrowcol, min=0.4), nrow=nrowcol, ncol=nrowcol, dimnames = list(hor, ver))
for (i in 1:nrowcol) cor[i,i] = 1

#Build the plot
rgb.palette <- colorRampPalette(c("blue", "yellow"), space = "rgb")
levelplot(cor, main="stage 12-14 array correlation matrix", xlab="", ylab="", col.regions=rgb.palette(120), cuts=100, at=seq(0,1,0.01))
http://stackoverflow.com/questions/5453336/plot-correlation-matrix-into-a-graph

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:将相关矩阵绘制成图形