rot_m <- matrix(c(0,-1,0,1,0,0,0,0,1),3,3)
ftransform <- function(x){
t(rot_m %*% as.numeric(matrix(m[x,],3,1)) + matrix(c(0,11,0),3,1))
}
foo <- lapply(1:nrow(m),ftransform)
foo <- data.frame(do.call(rbind,foo))
names(foo) <- c("Var1","Var2","value")
ggplot(foo, aes(Var1,Var2,fill=value)) +
geom_tile()
编辑:对于奇怪的图像格式/布局表示歉意。
这段内容与IT技术无关,只是一些说明。
... aes(rev(Var1), Var2, fill = value) ...
?还是+ scale_x_reverse()
? - Axeman