我有以下示例数据:
sel = structure(c(1.29955, 2.52295, 1.11021, 2.52008, 8.20255, 8.50118,
5.82189, 5.8108, 1.55928, 8.2552, 5.25119, 5.55055, 1.22525,
3.152, 3.9299, 5.50921, 5.25591, 5.11218, 1.55951, 2.5525,
9.2358, 2.0928, 5.2538, 2.5539, 8.52592, 2.59521, 5.55858,
5.92955, 2.22089, 1.52105),
.Dim = c(10L, 3L), .Dimnames = list(c("a", "b",
"c", "d", "e", "f", "g", "h",
"i", "j"), c("Label.1", "Label.2", "Label.3")))
Run Code Online (Sandbox Code Playgroud)
我使用此代码绘制图形:
col = c("#FF0000", "#FF0000", "#FF0000")
par(mar=c(7,4,4,2)+0.1)
png(filename='test.png', width=800, height=750)
heatmap.2(sel, col=redgreen(75), scale="row", ColSideColors=col,
key=TRUE, symkey=FALSE, density.info="none", trace="none")
graphics.off()
Run Code Online (Sandbox Code Playgroud)
这给了我这个热图:

如您所见,x轴标签被切断.我试图使par(mar=c(7,4,4,2)+0.1)(从默认值par(mar=c(5,4,4,2)+0.1))更大的边距,但这不会改变标签被切断的方式.
我试图改变lmat, …
我已经生成了这样的热图:

X轴和Y轴标签未完全显示.我的代码在这里:
heatmap.2(x,col=blueyelred,colsep=c(1:6),rowsep=(1:62),
sepwidth=c(0.05,0.05), sepcolor="white", trace="none",
Rowv=F,Colv=F, scale="none", dendrogram="none",key=F,
lhei = c(0.05,5),margins=c(1,8))
Run Code Online (Sandbox Code Playgroud)
有没有办法调整它.
谢谢!凸轮