colour for cells with NA value on gheatmap

310 views
Skip to first unread message

Yue

unread,
Sep 28, 2019, 3:31:44 PM9/28/19
to ggtree
Hi,

I'm making gheatmap with continuous values except some of the values are NA.

When I set the two colours for low and high, the cells with NA are white as I wish.

Screen Shot 2019-09-28 at 3.22.38 PM.png














But when I use a colour scale as below since I want more colours on heatmap, the NA cells are coloured as grey. 

Screen Shot 2019-09-28 at 3.16.39 PM.png







If I colour all the cells as white with scale_fill_gradientn(colours = "white"), those NA cells are still grey.
Screen Shot 2019-09-28 at 3.04.28 PM.png







I've tried to change the panel and plot background but it doesn't change.

So, how can I leave NA cells as white if I want to use a colour scale?

Yu, Guangchuang

unread,
Sep 29, 2019, 11:13:29 PM9/29/19
to Yue, ggtree
as usual, reproducible example pls.

--
1. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
2. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
3. Book: https://yulab-smu.github.io/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/f565b80c-20c8-4433-a19b-cf81aa603c8f%40googlegroups.com.


--
--~--~---------~--~----~------------~-------~--~----~
Guangchuang Yu PhD
Professor
School of Basic Medical Sciences
Southern Medical University
Guangzhou, China
-~----------~----~----~----~------~----~------~--~---
Reply all
Reply to author
Forward
0 new messages