我有以下情节:
我希望更改x轴标签,以便我可以使用" May"而不是" Mai" (首选)或者如果出现类似" 14-05-21 18:00"其中给出了完整的日期和小时。
我用于剧情的代码是:
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"))
并且x轴上的datetime变量具有类
> class(day5$datetime)
[1] "POSIXct" "POSIXt"
格式为
format="%Y-%m-%d %H:%M:%S", tz="Etc/GMT+0"
有什么想法吗?