ggtreeExtra icon indicating copy to clipboard operation
ggtreeExtra copied to clipboard

geom_fruit() doesn't work with geom_line?

Open Yiguan opened this issue 2 years ago • 0 comments

Hi,

Here is an example code with geom_tile:

trfile <- system.file("extdata", "tree.nwk", package="ggtreeExtra")
tree <- read.tree(trfile)
ring1 <- system.file("extdata", "first_ring_discrete.csv", package="ggtreeExtra")
dat2 <- read.csv(ring1)

p <- ggtree(tree)
p +  geom_fruit(
        data=dat2,
        geom=geom_tile, # geom_tile works well
        mapping=aes(y=ID, x=Pos, color=Type)
    ) 

It works well with geom_tile, geom_point, but if it is changed to geom_line, then the line layer will be shown on the left of the panel (overlaid with the root of the tree). I expect it to be the right side corresponding to the tips, as geom_tile or geom_point does.

I am not sure if geom_line not supported by geom_fruit yet, or somewhere I go wrong. Thanks in advance!!

Yiguan

Yiguan avatar Jul 14 '23 16:07 Yiguan