#' GGPlot2 Theme
#'
#' Custom Theme for GGPlot2 + GGPlotly
#' @param ... Add Additional Theme Parameters (if necessary)
#' @param base_size numeric
#'
#' @return
#' @export
#' @import ggplot2
#' @import extrafont
#'
#' @examples
#' ggplot(iris, aes(Petal.Width, Petal.Height)) +
#' geom_point() +
#' theme_jacob()
#'
theme_jacob <- function(..., base_size = 11) {
theme(panel.grid.minor = element_blank(),
panel.grid.major = element_line(color = "#d0d0d0"),
panel.background = element_rect(fill = "#f0f0f0", color = NA),
plot.background = element_rect(fill = "#f0f0f0", color = NA),
legend.background = element_rect(fill = '#f0f0f0', color = NA),
legend.position = 'top',
panel.border = element_blank(),
strip.background = element_blank(),
plot.margin = margin(0.5, 1, 0.5, 1, unit = "cm"),
axis.ticks = element_blank(),
text = element_text(family = "Gill Sans MT", size = base_size),
axis.text = element_text(face = "bold", color = "grey40", size = base_size),
axis.title = element_text(face = "bold", size = rel(1.2)),
axis.title.x = element_text(margin = margin(0.5, 0, 0, 0, unit = "cm")),
axis.title.y = element_text(margin = margin(0, 0.5, 0, 0, unit = "cm"), angle = 90),
plot.title = element_text(face = "bold", size = rel(1.05), hjust = 0.52, margin = margin(0, 0, .2, 0, unit = 'cm')),
plot.title.position = "plot",
plot.subtitle = element_text(size = 11, margin = margin(0, 0, 0.2, 0, unit = "cm"), hjust = 0.5),
plot.caption = element_text(size = 10, margin = margin(1, 0, 0, 0, unit = "cm"), hjust = 1),
strip.text = element_text(size = rel(1.05), face = "bold"),
strip.text.x = element_text(margin = margin(0.1, 0, 0.1, 0, "cm")),
...
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.