library(ggplot2)
p <- ggplot(data = iris,aes(x = Sepal.Length,y= Petal.Length, color = Species)) + geom_line()
p

ggthemes

  1. theme_economist: based on The Economist magazine’s plots.
  2. theme_few: follow the teachings of Stephen Few’s “Practical Rules for Using Color in Charts”.
  3. theme_fivethirtyeight: to create plots based on the fivethirtyeight.com theme.
  4. theme_tufte: based on the design principles described by Tufte in The Visual Display of Quantitative Information.
  5. theme_wsj: based on The Wall Street Journal’s plots.
# install.packages("ggthemes")
library(patchwork)
(p + ggthemes::theme_tufte())+(p+ggthemes::theme_calc())+(p+ggthemes::theme_clean())+(p+ggthemes::theme_economist())

hrbrthemes ,firatheme, urbnthemes

  1. theme_ipsum: Arial Narrow
  2. theme_ipsum_gs: Goldman Sans Condensed
  3. theme_ipsum_es: Econ Sans Condensed
  4. theme_ipsum_rc: Roboto Condensed
  5. theme_ipsum_ps: IBM Plex Sans font
  6. theme_ipsum_pub: Public Sans
  7. theme_ipsum_tw: Titilium Web
  8. theme_modern_rc: Roboto Condensed dark theme
  9. theme_ft_rc: Dark theme based on FT’s dark theme (Roboto Condensed)
# install.packages("hrbrthemes")


 p + hrbrthemes::theme_tinyhand()

这个包经常会出现这个错误:

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  polygon edge not found

bbplot

# devtools::install_github('bbc/bbplot')

p1 <- p + bbplot::bbc_style()
p2 <- bbplot::finalise_plot(plot_name = p,
source = "Source: ONS",
save_filepath = "filename_that_my_plot_should_be_saved_to-nc.png",
width_pixels = 640,
height_pixels = 550)

p1+p2

ggpomological

  1. theme_pomological(): watercolor styling theme based on paper background.
  2. theme_pomological_plain(): this theme is like the previous theme but with white or transparent background.
  3. theme_pomological_fancy(): colored paper background with fancy handwritten fonts.
# devtools::install_github("gadenbuie/ggpomological")

p1 <- p + ggpomological::theme_pomological()
p2 <- p + ggpomological::theme_pomological_fancy()
p3 <- p + ggpomological::theme_pomological_nobg()
p4 <- p + ggpomological::theme_pomological_plain()


p1+p2+p3+p4

# Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  polygon edge not found

ggthemr

  1. flat
  2. flat dark
  3. camouflage
  4. chalk
  5. copper
  6. dust
  7. earth
  8. fresh
  9. grape
  10. grass
  11. greyscale
  12. light
  13. lilac
  14. pale
  15. sea
  16. sky
  17. solarized
# devtools::install_github('Mikata-Project/ggthemr')

p1 <- p + (ggthemr::ggthemr(palette = "flat"))$theme + ggtitle("flat")
p2 <- p + (ggthemr::ggthemr(palette = "flat dark"))$theme + ggtitle("flat dark")
p3 <- p + (ggthemr::ggthemr(palette = "camouflage"))$theme + ggtitle("camouflage")
p4 <- p + (ggthemr::ggthemr(palette = "chalk"))$theme + ggtitle("chalk")

p1+p2+p3+p4

p1 <- p + (ggthemr::ggthemr(palette = "light"))$theme + ggtitle("light")
p2 <- p + (ggthemr::ggthemr(palette = "lilac"))$theme + ggtitle("lilac")
p3 <- p + (ggthemr::ggthemr(palette = "sea"))$theme + ggtitle("sea")
p4 <- p + (ggthemr::ggthemr(palette = "sky"))$theme + ggtitle("sky")

p1+p2+p3+p4

ggtech

  1. Airbnb
  2. Etsy
  3. Facebook
  4. Google
  5. Twitter
  6. 23andme
# devtools::install_github("ricardo-bion/ggtech", 
#                           dependencies=TRUE)

p1 <- p + ggtech::theme_airbnb_fancy()

会出现这个报错:

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  polygon edge not found

tvthemes

  1. Avatar: The Last Airbender
  2. Brooklyn Nine-Nine
  3. Game of Thrones/A Song of Ice & Fire
  4. Rick & Morty
  5. Parks & Recreation
  6. The Simpsons
  7. Spongebob Squarepants
  8. Hilda
  9. Attack on Titan
  10. Kim Possible
  11. Big Hero 6
  12. Gravity Falls
# devtools::install_github("Ryo-N7/tvthemes")


p1 <- p + tvthemes::theme_avatar() + ggtitle("avatar")
p2 <- p + tvthemes::theme_theLastAirbender() + ggtitle("theLastAirbender")
## Warning: 'tvthemes::theme_theLastAirbender' is deprecated.
## Use 'theme_avatar' instead.
## See help("Deprecated")
p3 <- p + tvthemes::theme_simpsons() + ggtitle("theme_simpsons")
p4 <- p + tvthemes::theme_brooklyn99() + ggtitle("theme_brooklyn99")


p1+p2+p3+p4

Artyfarty

# devtools::install_github('datarootsio/artyfarty')


p1 <- p + artyfarty::theme_bain() + ggtitle("bain")
p2 <- p + artyfarty::theme_scientific() + ggtitle("scientific")
p3 <- p + artyfarty::theme_economist() + ggtitle("economist")
p4 <- p + artyfarty::theme_monokai() + ggtitle("monokai")


p1+p2+p3+p4

ggdark

# devtools::install_github("nsgrantham/ggdark")

p1 <- p + ggdark::dark_theme_bw()
p2 <- p + ggdark::dark_theme_classic()
p3 <- p + ggdark::dark_theme_light()
p4 <- p + ggdark::dark_theme_minimal()

p1+p2+p3+p4