-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tip label angle with radial plotting #72
Comments
OK, after lots of experimenting, I've discovered that this appears to be an assumption within library(ggplot2)
library(ggtree)
library(deeptime)
library(ape)
data("chiroptera")
revts(ggtree(chiroptera) +
coord_geo_polar(theta = "y") +
geom_tiplab2(size=0.8)) Created on 2024-10-24 with reprex v2.1.1 You could change the y-scale to get a gap like in library(ggplot2)
library(ggtree)
library(deeptime)
library(ape)
data("chiroptera")
revts(ggtree(chiroptera) +
coord_geo_polar("epochs") +
scale_y_continuous(limits = c(0, NA), expand = expansion(0, c(0.6, 20))) +
geom_tiplab2(size = 0.8)) Created on 2024-10-24 with reprex v2.1.1 But, we can go a step further and use library(ggplot2)
library(ggtree)
library(deeptime)
library(ape)
data("chiroptera")
revts(ggtree(chiroptera) +
coord_geo_radial("epochs", start = -pi/2, direction = -1) +
geom_tiplab2(size = 0.8)) Created on 2024-10-24 with reprex v2.1.1 Tada! |
I've reached out to the ggtree folks to see if we can get |
Attempting to plot tip labels with coord_geo_radial leads to interesting bevahiour. Looks like the labels remain pivoted on the fist letter rather than adjusting for the angle as is done when plotting a circular tree with ggtree.
`library(ape)
library(ggtree)
library(deeptime)
data("chiroptera")
Standard ggtree plot
revts(ggtree(chiroptera, layout="circular") +
geom_tiplab(size=0.8))
Standard ggtree plot with geom_tiplab2 (for circular layout)
revts(ggtree(chiroptera, layout="circular") +
geom_tiplab2(size=0.8))
with coord_geo_radial
revts(ggtree(chiroptera) +
coord_geo_radial( dat = "epochs", abbrv = T)+
geom_tiplab(size=0.8))
with coord_geo_radial - even whackier with geom_tiplab2
revts(ggtree(chiroptera) +
coord_geo_radial( dat = "epochs", abbrv = T)+
geom_tiplab2(size=0.8))`
The text was updated successfully, but these errors were encountered: