@Macux
2015-12-01T06:50:57.000000Z
字数 1218
阅读 1165
R语言_学习笔记
(1)、生肉
> hgramt <- ggplot(movies,aes(rating)) + geom_histogram(binwidth=1,fill="lightblue") + labs(title="This is a histogram")
> hgramt
(2)、开始微调
> hgramt + theme(plot.title = element_text(size = 30))
> hgramt + theme(plot.title = element_text(size = 30, color="orange"))
> hgramt + theme(plot.title = element_text(size = 30, hjust=1))
> hgramt + theme(plot.title = element_text(size = 30, face="bold.italic"))
> hgramt + theme(plot.title = element_text(size = 30, angle=180))
> hgram <- ggplot(movies,aes(rating)) + geom_histogram(binwidth=1,fill="lightblue")
> hgram + theme(panel.grid.major = element_line(linetype="dotted",size=2,color="orange"))
> hgram + theme(axis.line = element_line(color="red",size=1.2,linetype="dashed"))
> hgram + theme(plot.background = element_rect(fill = "lightgoldenrod1",colour=NA))
> hgram + theme(panel.background = element_rect(fill="tan1",color=NA, linetype="dotted"))
> hgramt + theme(panel.grid.minor = element_blank())
> last_plot() + theme(panel.grid.major = element_blank())
> last_plot() + theme(panel.background = element_blank())
> last_plot() + theme(axis.title.x = element_blank(),axis.title.y = element_blank())
> last_plot() + theme(axis.line=element_line(color="orange"))