This relates to an earlier post
The example given is of US and German presidents.
When I create my own timeline using ggplot
. The timeline tags overlap. Please help. I'd either like the spacing longer along the x axis (I have events that occur only a day apart), or the tags alternating above and below the horizontal lines or tags slanting at 45 degrees.
Here's what I've got:
x <- data.frame(Entity = rep(c("Samsung", "Consumer", "Other"), each=3),
event = c("Note7 unveiled", "Sales in 10 markets",
"First battery fire", "Delay of Note7 shipped",
"Note7 China sales", "Global recall",
"FAA warns passengers", "Formal recall",
"Samsung being sued re burns"),
Year2016 = as.Date(c("2016-08-02", "2016-08-19", "2016-08-24",
"2016-08-31", "2016-09-01", "2016-09-02",
"2016-09-08","2016-09-15", "2016-09-16")))
library(ggplot2)
ggplot(x, aes(x=Year2016, y=Entity)) +
geom_line() +
geom_point() +
geom_text(aes(label=event), hjust=0, vjust=0) +
xlim(c(min(x$Year2016), max(x$Year2016)+10*0.25))
And here's the plot:enter image description here
Thanks for your help in advance.