## Taken from https://stackoverflow.com/questions/25401111/left-adjust-title-in-ggplot2-or-absolute-position-for-ggtitle
## ## Usage: plot is the ggplot object. Pieces is the list of items you want to left align.
## e.g. x <- left_align(figure, c("subtitle", "title", "caption"))
## then, to draw, use grid::grid.draw(x)
left_align <- function(plot, pieces){
grob <- ggplotGrob(plot)
n <- length(pieces)
grob$layout$l[grob$layout$name %in% pieces] <- 2
grob
}
get_colour <- function(col="blue", num=6, grid=bbc_colours){
subset(grid, colour==col & shade==num)$code
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.