美文网首页
ggplot2题目居中

ggplot2题目居中

作者: 一路向前_莫问前程_前程似锦 | 来源:发表于2020-03-27 22:08 被阅读0次

解决方式如下:

也就加上这一行

library(ggplot2)
ggplot(data=mtcars, aes(x=wt, y=mpg)) +
geom_point() +
labs(title="Automobile Data", x="Weight", y="Miles Per Gallon")+
theme(plot.title = element_text(hjust = 0.5)) #也就加上这一行

相关文章

网友评论

      本文标题:ggplot2题目居中

      本文链接:https://www.haomeiwen.com/subject/twxduhtx.html