目录:
(更多内容请见:R、ggplot2、shiny 汇总)
如何插入主题?
方法一:
library(ggplot2)
set.seed(2015)
diamond.part<-diamonds[sample(nrow(diamonds),100),]
b = ggplot(diamond.part, aes(x = carat, y = price)) +
geom_point(aes(colour = color))
b + theme_grey()
方法二:
library(ggplot2)
set.seed(2015)
diamond.part<-diamonds[sample(nrow(diamonds),100),]
b = ggplot(diamond.part, aes(x = carat, y = price)) +
geom_point(aes(colour = color))
b + theme_set(theme_grey())
ggplot2自带的两个主题:
theme_grey() 、theme_bw()
ggthemes包的十个主题:
安装ggthemes包以后便可使用如下十个主题:
theme_economist() 、theme_economist_white() 、theme_wsj() 、theme_excel() 、theme_few() 、theme_foundation() 、theme_igray() 、theme_solarized() 、theme_stata() 、theme_tufte()
主题效果:
转载请注明出处,谢谢!(原文链接:http://blog.csdn.net/bone_ace/article/details/47267505)