我无法改变当前图形中多条平滑曲线(stat_smooth())的颜色和线型。
以下是数据结构概述:
serviceInstanceName timestamp value
1 DE1Service-utilityPredicted 2014-02-22 10.000000
2 SE1Service-utilityPredicted 2014-02-22 4.385694
3 DE2Service-utilityPredicted 2014-02-22 0.000000
4 US1Service-utilityPredicted 2014-02-22 2.230000
5 DE1Service-utilityActual 2014-02-22 10.000000
6 SE1Service-utilityActual 2014-02-22 8.011919
7 DE2Service-utilityActual 2014-02-22 3.000000
8 US1Service-utilityActual 2014-02-22 1.325191
...
有八个独特的服务实例,每个实例都有相应的时间戳(y轴)和值(x轴)。
以下是代码:
ggplot(rmm, aes(x=timestamp, y=value, color=serviceInstanceName, group=serviceInstanceName))
+ stat_smooth(size=1.5, method = "loess", level = 0.95, fullrange = TRUE, se = FALSE)
+ scale_x_datetime(breaks = date_breaks("1 day"), labels = date_format("%a/%m"))
+ theme(axis.text.x = element_text(angle = 90, hjust = 1)) + xlab("Day")
+ ylab("Utility") + ggtitle("Utility Trend")
这里是情节:
![http://imgur.com/Tk02YXC](https://i.imgur.com/Tk02YXC.png?1)
任何帮助都会受到赞赏。谢谢!