R pheatmap 图例显示不完整/超出边界 添加标题 解决办

2022-11-14  本文已影响0人  生信摆渡

转换为ggplot对象,调整右边距

p <- pheatmap(...)
loadp(ggplotify)
as.ggplot(p) + theme(plot.margin = margin(l = 5, r = 10)) + 
        labs(title = "lncRNA heatmap") + 
        theme(plot.title  = element_text(color = "black", size = 20, face = "bold", hjust = 0.4))

前:


后:


上一篇下一篇

猜你喜欢

热点阅读