knitr::opts_chunk$set(echo = TRUE, fig.align = "center", fig.width = 4, fig.height = 4, warning = FALSE, error = FALSE, message = FALSE) devtools::load_all("..")
Last updated: r Sys.Date()
# Load ggplot2 library(ggplot2) # Load ggmitji library(ggmitji)
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(cols = vars(drv)) p
fill_strips_top(p = p, colors = c("red", "blue", "yellow"))
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(rows = vars(drv)) p
fill_strips_right(p = p, colors = c("red", "blue", "yellow"))
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(cols = vars(drv), switch = "x") p
fill_strips_bottom(p = p, colors = c("red", "blue", "yellow"))
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(rows = vars(drv), switch = "y") p
fill_strips_left(p = p, colors = c("red", "blue", "yellow"))
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(rows = vars(drv), cols=vars(fl)) p
# first the top strips and then the right strips fill_strips(p = p, side = c("top", "right"), colors = c("gray10","gray30", "gray50","gray70","gray90", "red", "blue", "yellow"))
# Example plot from https://ggplot2.tidyverse.org/reference/facet_grid.html p <- ggplot(mpg, aes(displ, cty)) + geom_point() p <- p + facet_grid(rows = vars(drv), cols=vars(fl), switch = "both") p
# first the bottom strips and then the left strips fill_strips(p = p, side = c("bottom", "left"), colors = c("gray10","gray30", "gray50","gray70","gray90", "red", "blue", "yellow"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.