3

I was wondering if there is a way to put images instead of numbers as X-axis labels in a scatter plot (or to that matter of fact, any plot) in R. I am currently using ggplot2 but any other library will be good enough. Any suggestions?

Legend
  • 113,822
  • 119
  • 272
  • 400
  • see also http://stackoverflow.com/q/2181902/471093 – baptiste Jul 23 '11 at 06:05
  • also, the vignette of grImport shows an example with lattice. I believe it could be adapted to work with ggplot2. – baptiste Jul 23 '11 at 23:03
  • what kind of image? The answer would be different for: - a vector graphic to import - a raster graphic to import - a glyph created from R - a glyph function (of size, shape, colour, etc.) -- see e.g. Chernoff faces – baptiste Jul 24 '11 at 22:37
  • I will look into the `grImport1 package. I am trying to import a set of raster images to substitute them as X-axis labels. – Legend Jul 24 '11 at 22:41
  • I would suggest using tikzDevice and get LaTeX to place the graphics for you. An example is at http://groups.google.com/group/ggplot2/browse_thread/thread/38f8695ad55cc2d6?pli=1 – baptiste Jul 25 '11 at 00:32

1 Answers1

2

Look at the my.symbols function in the TeachingDemos package along with ms.image (same package) for one option using base graphics.

Greg Snow
  • 48,497
  • 6
  • 83
  • 110