library(ggplot2)
p <- ggplot(data = iris,aes(x = Sepal.Length,y= Petal.Length, color = Species)) + geom_line()
p
# install.packages("ggthemes")
library(patchwork)
(p + ggthemes::theme_tufte())+(p+ggthemes::theme_calc())+(p+ggthemes::theme_clean())+(p+ggthemes::theme_economist())
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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