Closed willgearty closed 3 months ago
This exposes the position argument for geom_range() so you can do something like the following:
position
geom_range()
library(ggplot2) library(ggtree) library(treeio) library(deeptime) file <- system.file("extdata/BEAST", "beast_mcc.tree", package="treeio") beast <- read.beast(file) ggtree(beast, position = position_nudge(x = -500)) + geom_range(range='length_0.95_HPD', color='red', alpha=.6, size=2, position = position_nudge(x = -500)) + scale_x_continuous(breaks = seq(-500, -460, 10), labels = abs(seq(-500, -460, 10))) + theme_tree2() + coord_geo(pos = list("bottom", "bottom"), dat = list("stages", "periods"), neg = TRUE, ylim = c(0, NA), center_end_labels = TRUE, abbrv = list(TRUE, FALSE))
This is particularly useful for plotting trees that are made up of entirely extinct taxa which you need to bump backwards in time (since ggtree puts the root at 0).
This exposes the
position
argument forgeom_range()
so you can do something like the following:This is particularly useful for plotting trees that are made up of entirely extinct taxa which you need to bump backwards in time (since ggtree puts the root at 0).