Visualizing Innovation

Themes

Dr. Matthias Schnetzer

November 27, 2023

Themes

Themes

Theme elements

Main theme components

data |> ggplot(aes(x = var1, y = var2)) |>
  geom_line() +
  theme_minimal() +
  theme(plot.background = element_rect(fill = "red"),
        panel.grid.x = element_blank(),
        axis.line.x = element_line(linewidth = 1.2),
        legend.text = element_text(size = 7),
        legend.position = "top")


Plot Panel Axis Legend Strip
background background title background background
title border text key placement
subtitle grid ticks title text
caption spacing line text
margin position

Add a Logo to your plot

library(magick)
logo <- image_read("patentamt.png")

# png("finalplot.png", bg = "white", width = 8, height = 6, res = 320, units = "in")
mtcars |> ggplot(aes(x = wt, y = mpg)) +
  geom_point() +
  labs(title = "Chart with a logo", caption = "Figure: @matschnetzer") +
  theme_minimal()
grid::grid.raster(logo, x = 0.03, y = 0.01, just = c('left', 'bottom'), width = unit(1.3, 'in'))
# dev.off()