ohmyggplot
suppressPackageStartupMessages({ library(dplyr) library(ggplot2) library(ohmyggplot) }) knitr::opts_chunk$set(echo = TRUE)
Your ggplot2 with better defaults.
ohmyggplot
library(ggplot2) library(patchwork) p1 = ggplot(iris) + geom_point(aes(Sepal.Length, Sepal.Width, color = Petal.Length), alpha = 0.8) + theme(legend.position = "top") + labs(title = "A dull plot, isn't it?") p2 = ggplot(iris) + geom_point(aes(Sepal.Length, Sepal.Width, color = Species), alpha = 0.8) p1 + p2
ohmyggplot
library(ohmyggplot) #initiate ohmyggplot oh_my_ggplot() p = ggplot(iris) + geom_point(aes(Sepal.Length, Sepal.Width, fill = Petal.Length), alpha = 0.8) + theme(legend.position = "top") + labs(title = "A better plot, without extra code!") + better_fill_legend p
geom_caviar
p = ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_caviar(aes(color = Petal.Length)) + theme(legend.position = "top") + labs(subtitle = "Bordered scatter plot with geom_caviar") + better_fill_legend p
ggRetro
library(ggRetro) ggRetro::base_mode(p) + theme(legend.position = "top") + labs(title = "Now with floating axes!")
ggsci::npg
ggRetro::base_mode({ ggplot(iris) + geom_point(aes(Sepal.Length, Sepal.Width, fill = Species), alpha = 0.8) }) + theme(legend.position = "top")
remotes::install_github("albert-ying/ohmyggplot") # Or devtools::install_github("albert-ying/ohmyggplot")
This package is inspired by Dr. Cédric Scherer's talk {ggplot2} Wizardry
The default theme is build on hrbrthemes
.
The default color is from ggsci
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.