12

These days I am extensively using R to scatter plots. Most of the plotting is concerned with image processing, Recently I was thinking of plotting the scatter plots over an image.

For example, I want something like this, The background needs to be filled with my image. With a particular scale. And I should be able to draw points (co-ordinates) on top of this image ...

Is this possible in R? If not, do you guys know of any other tool that makes this easy ...

Alphaneo
  • 12,079
  • 22
  • 71
  • 89

2 Answers2

9

I'm not 100% sure what you have in mind, but I think first you want to load and plot an image in R. You can do that with the ReadImages package:

picture <- read.jpeg("avatar.jpg")
plot(picture)

Then you can do a scatter plot on top of it:

points(runif(50,0, 128), runif(50,0,128))
zx8754
  • 52,746
  • 12
  • 114
  • 209
Jonathan Chang
  • 24,567
  • 5
  • 34
  • 33
8

A step-by-step tutorial to this kind of plotting is in the R-wiki

Aaron Statham
  • 2,048
  • 1
  • 15
  • 16