Skip to content

Plotting using image files

1 message · Greg Snow

#
different image files (jpegs, gif, etc.) as the plot symbols.
matrix, but I thought someone might have a better
file into a specific coordinate within a scatterplot?

Here is an example using cnvrt.coords from the TeachingDemos package
and the jpeg plotting functions from the rimage
package:

library(TeachingDemos)
library(rimage)
data(logo)

x <- runif(10,3,6)
y <- runif(10,100,200)

plot(x,y, type='n')

cp <- par(no.readonly=TRUE)
tmp <- cnvrt.coords(x,y)

for (i in 1:10){
  par(plt=c(tmp$dev$x[i] + c(-0.03,0.03), tmp$dev$y[i] +
c(-0.03,0.03)),
      new=TRUE)
  plot(logo)
}

par(cp)


hope this helps,

Greg Snow, Ph.D.
Statistical Data Center, LDS Hospital
Intermountain Health Care
greg.snow at ihc.com
(801) 408-8111