I am wondering if there is a generic way to overlay any R plot / visualization appearing in the R output window with a logo (as well as position it) so output is always bran
if you are looking for an easy solution, the simplest way to do it would be to overlay your plot with a custom background:
require(ggplot2); require(grid); require(png);
data(mtcars)
# read background image, stacks website logo in this case
img <- readPNG(source = "so.png")
# add rater
g <- rasterGrob(img, interpolate=TRUE)
# Basic plot
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
annotation_custom(g, xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf)
The code would produce the following result: Naturally, you can adjust your background by changing the image and placement to make it look more like a proper logo if you wish.