On Thu, 5 Aug 2004, Wolfram Fischer wrote:

> > Hello
> > 
> > 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.
> > 
> > Wolfram
> 
> I found the package pixmap with the functions
>       x <- read.pnm( file )
> and
>       plot(x)
> 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:
>     library(pixmap)
>     example(pixmap)
>     plot(x)
>     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?
> 

This is covered in the code for the addlogo function in the pixmap 
package:

> help("addlogo-methods")
> getMethod("addlogo", "pixmap")

which uses the pixmap bounding box and user-supplied coordinates and an 
aspect argument to scale a pixmap object. If the function itself doesn't 
do what you need, it does show the slots you could use directly.

Roger


> Wolfram
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: [EMAIL PROTECTED]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to