Closed zhanxw closed 3 years ago
The latest github version has supported this feature.
library(ggtreeExtra) library(ggtree)
library(ggplot2)
set.seed(123)
tree <- rtree(10)
mat = expand.grid(y = tree$tip.label, type = paste('sm', seq(3), sep = ''))
mat$val <- rnorm(nrow(mat))
mat
p <- ggtree(
tree
)
p <- p +
geom_fruit(
data = mat,
geom = geom_tile,
mapping = aes(y=y, x=type, fill=val),
axis.params=list(
axis="x",
title = "mat",
text.angle = -45,
text.size = 2,
line.size = 0,
vjust = 0
)
)
p
Thanks for the new version.
@zhanxw Does this subplot title still work when you have 2 calls to ggfruit() resulting in 2 side by side subplots?
Thanks for developing ggTreeExtra.
geom_fruit
is very handy compared togeom_facet
. But I do not know how to add a facet title usinggeom_fruit
.Below is the code using
geom_facet
and obtain the facet titlemat
. I wonder how to draw the same facet title or x-axis label usinggemo_fruit
.Figure output