Question: Correlation heatmap using qplot function in ggplot2
0
gravatar for Dtriumph
2.8 years ago by
Dtriumph30
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)

library(ggplot2)

library(reshape2)

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

Thank you in advance!

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

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

Colour gradient : http://docs.ggplot2.org/current/scale_gradient.html

Axis formatting : http://www.cookbook-r.com/Graphs/Axes_%28ggplot2%29/

ADD COMMENTlink written 2.8 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 2.8 years ago • written 2.8 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 plot.ly package. ggplot is fantastic but I found it a little more intractable for heatmaps specifically. Plot.ly's are interactive too which is nice.

ADD REPLYlink written 2.8 years ago by jrj.healey11k
Please log in to add an answer.

Help
Access

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