2
$\begingroup$

I plotted a heatmap

I want cancer to be red and healthy to be blue

   pheatmap(heat1, annotation_col=df,color=colorRampPalette(c("navy", "white", "red"))(50))

You are seeing cancer is in blue in annotation, how I can change thatenter image description here

$\endgroup$

1 Answer 1

5
$\begingroup$

It is possible with annotation_colors argument :

First create a list with your conditions and then add the argument :

annot_colors=list(HealthStatus=c(Cancer="#F0978D",Healthy="#63D7DE"))
    
pheatmap(heat1,
         annotation_col=df,
         color=colorRampPalette(c("navy", "white", "red"))(50),
         annotation_colors=annot_colors)
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.