这有可能用ggplot2重现这个格子图吗?
library(latticeExtra)
data(mtcars)
x <- t(as.matrix(scale(mtcars)))
dd.row <- as.dendrogram(hclust(dist(x)))
row.ord <- order.dendrogram(dd.row)
dd.col <- as.dendrogram(hclust(dist(t(x))))
col.ord <- order.dendrogram(dd.col)
library(lattice)
levelplot(x[row.ord, col.ord],
aspect = "fill",
scales = list(x = list(rot = 90)),
colorkey = list(space = "left"),
legend =
list(right =
list(fun = dendrogramGrob,
args =
list(x = dd.col, ord = col.ord,
side = "right",
size = 10)),
top =
list(fun = dendrogramGrob,
args =
list(x = dd.row,
side = "top",
size = 10))))
Run Code Online (Sandbox Code Playgroud)

我的数据看起来像这样:
Name h1 h2 h3 h4 h5
1 1420468_at_Asb17 0.000 2.328 0.000 0.000 0.000
2 1430261_at_1700024J04Rik 1.236 2.050 0.000 0.000 0.000
3 1431788_at_Fabp12 0.000 2.150 0.000 0.000 0.587
4 1433187_at_B230112I24Rik 0.000 2.240 1.343 0.000 1.383
5 1434430_s_at_Adora2b 0.000 2.006 1.459 0.000 1.272
6 1435217_at_Gm7969 0.727 2.350 1.494 0.976 0.000
7 1436717_x_at_Hbb-y 0.000 2.712 0.000 0.000 0.000
8 1440859_at_Akap6 0.000 2.053 0.000 0.000 1.840
9 1442625_at_--- 0.000 2.064 1.173 0.000 1.035
10 1443715_at_Rbm24 0.969 2.219 0.000 0.000 0.000
11 1445520_at_--- 0.000 …Run Code Online (Sandbox Code Playgroud)