This post is an instructional one on how to plot a chart on top of a background image in ggplot2 and R. The motivation for plotting on a background may just be a design choice or it may serve the purpose of supporting the message of the chart. I will show how i create my previous post's chart showing the location of successful free kicks on a football pitch. Below code creates a 10x10 matrix with normally distributed doubles, which we will use as dummy data so you can easily replicate the results. N <- 10 M <- 10 data <- matrix(rnorm(N*M,mean=0,sd=1), N, M) We can convert this into a data frame and plot the initial data. library(ggplot2) df <- as.data.frame(as.table(data)) ggplot(df, aes(Var2, Var1)) + geom_tile(aes(fill = Freq)) + scale_fill_gradient(low = "white", high = "tomato") Next we need a background image which you can import with the jpeg package. In my case this is a picture of half a football pitch. library(jpeg)