首页 > 其他 > 详细

R 画散点图

时间:2019-09-10 15:28:18      阅读:95      评论:0      收藏:0      [点我收藏+]
 ggplot(data=df, aes(x=n, y=rt, group=kernel, shape=kernel, colour=kernel)) + 
     geom_point(fill="white", size=3) + geom_line() + xlab("n") + ylab("Runtime (s)") + 
     opts(title=title,plot.title=theme_text(size=font.size)) + 
     scale_colour_manual(values=c("grey30", "red")) + 
     opts(legend.position = c(x_shift,0.87),legend.background=theme_rect(fill = "transparent",colour=NA))

标题居中

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))  #也就加上这一行
 

R 画散点图

原文:https://www.cnblogs.com/shanyr/p/11497408.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!