setwd("/home/share_data1/luchh/new_TS/TFexheatmap/")
library(pheatmap)
library(grid)
data <- read.table("2232TFexFPKM.txt", header = TRUE, row.names = 1)
my_gpar <- gpar(fontfamily = "Arial") # 设置字体
pdf("TFexheatmap.pdf",width=15,height=30)
pheatmap(data,
color = colorRampPalette(c("blue", "white", "red"))(500),
cluster_rows = TRUE,
cluster_cols = TRUE,
fontsize_col = 8,
scale = "none",
legend_breaks = c(0, 1, 2),
show_rownames = FALSE,
main = "2232TF_TS_FPKM", # 添加引号以包围标题
fontsize_row = 4,
angle_col = 45,
gpar = my_gpar,
width = 10,
height = 30) # 请确保定义了 my_gpar 对象
dev.off()
pheatmap画图
于 2023-10-24 22:40:22 首次发布