# NOT RUN {
library(ggplot2)
# the original matrix
m=matrix(c(
"red", "yellow", "green",
"blue", "purple", "cyan",
"black", "orange", "grey"), byrow=TRUE, nrow=3)
# enlarge the matrix
mm=enlarge_raster(m, c(15, 15), space="Lab")
ggplot()+xlim(0, 10)+ylim(0, 5)+coord_fixed()+
annotation_raster(mm,
xmin=0, xmax=10, ymin=0, ymax=5, interpolate=TRUE)
# }
Run the code above in your browser using DataLab