I have the following plot:
and I want to change the x-axis label so that I either have "May" instead of "Mai" (preferred) or if that fails something like "14-05-21 18:00" in which the full date and the hour are given.
The code I use for the plot is:
library(ggplot2)
library(grid)
ggplot(day5, aes(datetime)) +
geom_line(aes(y = ET.Lys, colour = "ET.Lys")) +
geom_line(aes(y = ET.PM, colour = "ET.PM"))+
scale_y_continuous(breaks=c(0,0.2, 0.4, 0.6, 0.8, 1, 1.2), limits=c(0,1.2)) +
xlab("\n date and time") +
ylab("ET [mm/h]\n") +
theme_bw(25)+
theme(legend.title=element_blank(),
legend.justification = c(1, 1), legend.position = c(1,1),
legend.background=element_rect(color = "grey",fill = "white", size = 0.1, linetype = "solid"),
legend.key = element_blank(),
legend.text=element_text(size=20))+
geom_line(aes(y = ET.Lys, colour = "ET.Lys"), size=1)+
geom_line(aes(y = ET.PM, colour = "ET.PM"), size=1)+
theme(plot.margin=unit(c(0.5,2,0.5,0.5), "cm"))
and the datetime variable on the x-axis has the class
> class(day5$datetime)
[1] "POSIXct" "POSIXt"
with the format
format="%Y-%m-%d %H:%M:%S", tz="Etc/GMT+0"
Any ideas?