Question: Correlation heatmap using qplot function in ggplot2
gravatar for Dtriumph
3.5 years ago by
Dtriumph30 wrote:

Hello everyone, I'm trying to generate a correlation heatmap for expression values of my RNAseq samples using qplot function in ggplot2. I could generate the heatmap using the below code and it's default color is blue. Now I need to change the color of the map to a red to yellow gradient and also to change the axes text size and color. Can anyone help me with this?

correlation<-read.table("new_cor.txt", header=TRUE)



qplot(x = Var1 , y=Var2, data=melt(cor(correlation)), fill=value, geom="tile")

Thank you in advance!

rna-seq genome • 1.7k views
ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by Dtriumph30
gravatar for S.Warchal
3.5 years ago by
S.Warchal30 wrote:

The ggplot2 documentation is very good and there are countless tutorials, it's worth searching before asking simple questions,

Colour gradient :

Axis formatting :

ADD COMMENTlink written 3.5 years ago by S.Warchal30

I'm new to R, so still searching for resources. Thanks so much for the links! It worked nicely...

ADD REPLYlink modified 3.5 years ago • written 3.5 years ago by Dtriumph30

It's a little off-topic relative to the query as posed by the OP, but my personal choice for heatmaps in R is the package. ggplot is fantastic but I found it a little more intractable for heatmaps specifically.'s are interactive too which is nice.

ADD REPLYlink written 3.5 years ago by Joe15k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 904 users visited in the last hour