knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) dir.create("svg", showWarnings = FALSE)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # install devout and its dependencies # # svgpatternsimple - a set of simple patterns in SVG # devout - Framework for creating graphics devices in plain R # devoutsvg - Custom SVG device #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # devtools::install_github("coolbutuseless/svgpatternsimple") # devtools::install_github("coolbutuseless/devout") # devtools::install_github("coolbutuseless/devoutsvg") suppressPackageStartupMessages({ library(devout) library(devoutsvg) library(svgpatternsimple) library(dplyr) library(tidyr) library(ggplot2) library(ggridges) })
This vignette recreates a plot with vertical colour gradient. It was developed by VictimOfMaths and the complete version is available on github.
The image below on the left is from the UK Office for National Statistics (ONS).
The image on the right is created using R
, ggplot
and devoutsvg
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.