Skip to content
Back to formatted view

Raw Message

Message-ID: <430B38C4.4070006@free.fr>
Date: 2005-08-23T14:55:00Z
From: Romain Francois
Subject: Plotting using image files
In-Reply-To: <000a01c5a7e1$810f7040$9ba76f82@CFRU0104>

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    ~~~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~