I have a set of 150x150px png images, and a set of (x, y) coordinates that they correspond to. Is there a way to plot the images on a grid? For example, I\'m looking for an
One way to do it in R (2.11.0 and higher):
library("png")
# read a sample file (R logo)
img <- readPNG(system.file("img", "Rlogo.png", package="png"))
# img2 <- readPNG(system.file("img", "Rlogo.png", package="png"))
img2 <- readPNG("hand.png", TRUE) # here import a different image
if (exists("rasterImage")) {
plot(1:1000, type='n')
rasterImage(img, 100, 100, 200, 200)
rasterImage(img2, 300, 300, 400, 400)
}
see ?readPNG and ?rasterImage for details.