0

I am trying to create a scatter plot with customized point shapes. For various reasons I would like to replace the standard point shapes in ggplot2 scatter plot with shapes that don't exist in the standard ggplot2 shape set.

I understand the general principle of changing shapes in a scatter plot but I would like to know if it is even possible to import an image (SVG, png, jpg, etc) and then use it in ggplot2.

So if this was my plot:

mtcars
ggplot(mtcars, aes(x=hp, y=mpg)) + geom_point(shape=12)

How would I replace the shape with an image (import it, make it available to ggplot2, reference it in geom_point).

Note that a previous post has addressed this issue but it is in my opinion unclear what the author meant; the links are broken and there isn't code that would clarify this matter. Here is the old post regarding this issue for your reference:

How to use an image as a point in ggplot?

Thanks. In case anyone is interested, the shape I am trying to enter is a little person (stick figure, think xkcd)

Community
  • 1
  • 1
SprengMeister
  • 550
  • 1
  • 4
  • 12
  • 2
    http://stackoverflow.com/questions/27637455/is-it-possible-to-display-custom-image-say-png-format-as-geom-point-in-r-ggplo might help for a quick (but not perfect) way – user20650 Aug 25 '15 at 17:43
  • @user20650 that link looks promising. I completely missed that. – SprengMeister Aug 25 '15 at 17:46

0 Answers0