Re: [R] Plotting using image files

From: Romain Francois <francoisromain_at_free.fr>
Date: Wed 24 Aug 2005 - 00:55:00 EST

Le 23.08.2005 14:52, Mike Saunders a écrit :

>This is a strange request, but I want to build a scatterplot using different image files (jpegs, gif, etc.) as the plot symbols. I have thought about setting this up using a very large layout matrix, but I thought someone might have a better approach. Furthermore, is there any way to have R paste an image file into a specific coordinate within a scatterplot?
>
>Thanks in advance,
>Mike
>
>
>
Hello Mike,

Maybe you can try using the pixmap package, something like this :

require(pixmap)
logo <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1]) x <- rnorm(10)
y <- rnorm(10,sd=.4)+x
plot(x,y, type="n")

for(i in 1:10){       
                  u <- runif(1)/10 + .1
                  addlogo(logo, x[i]+c(-u,u), y[i]+c(-u,u), asp=1)
}
# points(x,y, pch="+")

All you have to de then is having your images in ppm format. I think gimp will do it for you.
There is also a few tools in netpbm (only on linux i think).

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~      Romain FRANCOIS - http://addictedtor.free.fr         ~~~~~~
~~~~        Etudiant  ISUP - CS3 - Industrie et Services           ~~~~
~~                http://www.isup.cicrp.jussieu.fr/                  ~~
~~~~           Stagiaire INRIA Futurs - Equipe SELECT              ~~~~
~~~~~~   http://www.inria.fr/recherche/equipes/select.fr.html    ~~~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Aug 24 00:59:19 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:44:28 EST