I\'m trying to add a picture (jpeg,png doesn\'t care) to a plot which is defined by the layout function. For example:
a<-c(1,2,3,4,5)
b<-c(2,4,8,16,32
You need to read your png or jpeg file through the png and jpeg packages. Then, with the rasterImage function you can draw the image on a plot. Say that your file is myfile.jpeg, you can try this:
require(jpeg)
img<-readJPEG("myfile.jpeg")
#now open a plot window with coordinates
plot(1:10,ty="n")
#specify the position of the image through bottom-left and top-right coords
rasterImage(img,2,2,4,4)
The above code will draw the image between the (2,2) and (4,4) points.