knitr::opts_chunk$set(echo = TRUE)
geUseTheme: use a preset theme for plotting (support bw or classic at the moment)geGetColors: get a vector of colorsitalicize.string: italicize strings in a sentenceitalicize.plot: italicize strings in a ggplotKnown issues with italicize.plot:
scale_color_ge/scale_fill_ge: selected color schemetheme_bw_getheme_classic_getheme_umap_geKnown issue with theme_umap_ge: this is a function returns a list of geom_text, geom_segment and theme_void(). Better implementation should define element_line_umap that can be used in theme(axis.line)
devtools::install_github("lch14forever/ggessentials")
library(ggessentials) ## to get a list of colors (1-17) colors <- geGetColors(3) data("iris") ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_manual(values=colors) + theme_bw_ge()
p <- ggplot(iris, aes(x=Species, y=Sepal.Width, color=Species)) + geom_boxplot() + scale_color_manual(values=colors) + theme_bw_ge() grid::grid.draw(italicize.plot(p, string = c('setosa', 'versicolor')))
## preset the theme geUseTheme('classic') ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_manual(values=colors)
scale_color_ge or scale_fill_geggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_ge()
ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, fill=Species)) + geom_point(shape=21) + scale_fill_ge()
ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + theme_umap_ge()
Another implementation [will be replaced by theme_umap_ge soon]
g <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_manual(values=colors) + theme_bw_ge() add_axes_umap(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.