[R] import a bitmap image and add it to graphics display
wolfram at fischer-zim.ch
Thu Aug 5 11:03:40 CEST 2004
> Is there a possibility to import and add a bitmap image (png or
> similar) to a R graphics display. It would be helpful e.g. to
> locate positions of points of a scanned map or to add a background
> to a R graphic.
I found the package pixmap with the functions
x <- read.pnm( file )
This plots pnm pictures as R graphics.
(Other picture formats can be converted to pnm pictures
by several pnm commands on Linux or by using gimp.)
Overlaying such a picture with a graph could be done as follows:
m <- 20 ; points( x=m*c(0,1,2), y=m*c(0,2,1), col='red', type='b', lwd=5 )
There rests a problem with the scale:
Question: How can I scale a pixmap object?
More information about the R-help