I've created a stream plot from a time series and need 2 vertical line labelled with text "ignite" and "extinguish" repectively.
Given that it's a time series I'm having real problems getting the labels to display.
Here's the ggplot code thus far:
ggplot(airDataClean, aes(x = Date, y = maxParticulates, fill = Location)) +
geom_vline(aes(xintercept = as.numeric(ymd("2019-10-26"))), color='red') +
geom_vline(aes(xintercept = as.numeric(ymd("2020-02-10"))), color='blue') +
geom_stream(color = 1, lwd = 0.25) +
theme(axis.text.y = element_blank(), axis.ticks.y = element_blank()) +
scale_fill_manual(values = cols) +
scale_x_date(expand=c(0,0)) +
ylab("Particulate Pollution (index of poor air quality)") +
xlab("Black Summer 19/20")
Results show:
Labelling the first line I've tried:
annotate(aes(xintercept= as.numeric(ymd("2019-10-26"))),y=+Inf,label="Ignite",vjust=2,geom="label") +
but it throws
"Error: Invalid input: date_trans works with objects of class Date only"
Any help would be greatly appreciated.