This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Color key in Heatmap.plus package

I am using following code to generate a heat map in heat map.plus

heatmap.plus(data_rearranged, cexRow = 0.6 + 1/log10(5), cexCol = 0.6 + 1/log10(10),
 scale="row", keep.dendro=FALSE,
 ColSideColors=colc,
 Rowv=NULL, Colv=NULL,main="Heatmap"
 col=my_palette,margin=c(20,10))

How can I add the color key in this?

Also I wanted to add two legends,how can I add one below other?These two legends don't look nice as one is in the left and other is at bottom left.

legend("left",      # location of the legend on the heatmap plot
 legend = c("Class1","Class2"), # category labels
 col = c("blue", "yellow"),  # color key
 lty= 2,             # line style
 lwd = 32            # line width
 )

legend("bottomleft",      # location of the legend on the heatmap plot
 legend = c("label1","label2"), # category labels
 col = c("orange", "pink"),  # color key
 lty= 2,             # line style
 lwd = 32            # line width
 )
r

0 answers

No answers yet.

Log in to answer this question.