如何更改此图中的以下内容?
- 更改趋势线的颜色(当前为蓝色)
- 更改峰值点的颜色(当前为橙色)
- 更改时间序列模式线的颜色(当前为黑色)
- 添加图例以指示以上所有三个的颜色
代码来源:
# Libraries used:
library(ggplot2)
library(timeSeries)
library(ggfortify)
library(ggthemes)
library(dplyr)
library(strucchange)
strucchange::breakpoints(AirPassengers ~ 1) %>%
autoplot(ts.linetype = 'solid', ts.size = 1.1, ts.geom = 'line')+
geom_smooth(aes(y=AirPassengers),
method = "loess", se= F,
lwd = 1.2) +
geom_point(aes(y = AirPassengers), size = 1.5, shape = 16, color = "orange3")+
scale_x_date(date_breaks = "1 years", date_labels = "%Y")+
labs(title = "Yearly Time Series",
subtitle="Sales trend from Year 2001 to 2017",
caption="Source: Airpassengers Time Series Analysis",
y="Sales", x = "Years")+
theme_economist_white()+
theme(axis.text.x = element_text(angle = 90, hjust = -.1))