解决方式如下:
也就加上这一行
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)) #也就加上这一行
解决方式如下:
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
网友评论