我的脚本文件中有一个简单的 ggplot 命令:
ggplot(myea_running, aes(x=DistanceMeters, y=AvgPace,
color=month(myea_running$StartTime))) +
geom_point(aes(size = TotalTimeSeconds)) +
geom_smooth() +
ggtitle("Distance (m) over average pace (min / km)") +
labs(x="Distance", y="Average pace")
我想更改上述代码生成的默认颜色标题。我查看了文档,但没有找到任何有关将标题放在使用 aes() 函数的 color 属性生成的颜色代码上的相关信息。
试试这个:
ggplot(myea_running, aes(x=DistanceMeters, y=AvgPace,
color=month(myea_running$StartTime))) +
geom_point(aes(size = TotalTimeSeconds)) +
geom_smooth() +
ggtitle("Distance (m) over average pace (min / km)") +
labs(x="Distance", y="Average pace",
color = "Month", size = "Total Time in Seconds")
对于四个变量的透明度问题,请像这样修改您的代码:
geom_point(aes(size = TotalTimeSeconds), alpha = 0.4)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句