Last active
September 27, 2019 22:02
-
-
Save Swarchal/53104181a30c2bb6b62d to your computer and use it in GitHub Desktop.
heatmap.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(reshape2) | |
df_expression <- read.csv("expression.csv") | |
df_molten <- melt(df_expression) | |
ggplot(data = df_molten, | |
aes(x = variable, y = MouseID, fill = value)) + | |
geom_raster() + | |
xlab("Protein") + | |
scale_fill_distiller(palette = "RdYlBu", trans = "log10") + | |
theme(axis.text.x = element_text(angle = 90, hjust = 1), | |
axis.text.y = element_blank()) + | |
ggtitle("ggplot heatmap") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, Thanks for the nice sharing of the heatmap generation. I am reproducing your commands using my own datasets and found the output. In your heatmap, in the y-axis (mouse id), you did not show all labeling of mouse id [(e.g., axis.text.y = element_blank())]. would you please improve this section for how to show all samples id in y-axes . Thanks ....