ggplot2——主题篇

目录:

  • 如何插入主题?
  • ggplot2自带的两个主题
  • ggthemes包的十个主题

(更多内容请见: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()

ggplot2——主题篇_第1张图片


ggthemes包的十个主题:

安装ggthemes包以后便可使用如下十个主题:

theme_economist() 、theme_economist_white() 、theme_wsj() 、theme_excel() 、theme_few() 、theme_foundation() 、theme_igray() 、theme_solarized() 、theme_stata() 、theme_tufte()

主题效果:

ggplot2——主题篇_第2张图片

ggplot2——主题篇_第3张图片

ggplot2——主题篇_第4张图片

ggplot2——主题篇_第5张图片

ggplot2——主题篇_第6张图片

ggplot2——主题篇_第7张图片

ggplot2——主题篇_第8张图片



转载请注明出处,谢谢!(原文链接:http://blog.csdn.net/bone_ace/article/details/47267505)

你可能感兴趣的:(r,主题,ggplot2,ggthemes)