我有以下代码:
my_palette <- colorRampPalette(rev(RColorBrewer::brewer.pal(11, "RdBu")))(n = 50)
par(mar = c(7, 4, 4, 2) + 0.1)
gplots::heatmap.2(as.matrix(mtcars),
Colv = TRUE,
Rowv = TRUE,
col = my_palette,
density.info = "none",
key = TRUE,
scale = "none",
ylab = "Y_LABEL",
xlab = "X_LABEL",
trace = "none",
margins = c(12, 8))
它产生了这个情节:
如上所示,“ X_LABEL”与列名之间的距离 太远了。我该如何减少呢?