I am trying to make a heat map using ggplot and geom_tiles using this code
HeLa_half_life_CpG <- read_excel("HeLa_mRNA_stability_chip1_2_combined.xlsx",
sheet = "in_CpG")
melted_CpG <- melt(HeLa_half_life_CpG)
melted_CpG$Genes <- factor(melted_CpG$Genes, levels = unique(melted_CpG$Genes))
pdf("mRNA_stability_CpG.pdf", width = 3, height = 6)
ggplot(melted_CpG, aes(variable, Genes, fill= value)) +
geom_tile()+
xlab("Hours")+
ylab("")+
labs(fill = "% mRNA remaining")+
scale_fill_gradient(low="white",high="blue")+
theme_minimal() +
theme(
text = element_text(size = 14), # Adjust the size as needed
axis.text.y = element_blank(), # Remove y-axis labels
axis.text.x = element_text(size = 14),
legend.position = "none")
dev.off()
The heatmap has white space between the tiles of each gene.
enter image description here
I want to remove this space, please help.
I tried
geom_tile(width = 1)
option but it didn’t work.
New contributor
Mohd Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.