GuangchuangYu / ggimage

:art: Use Images in ggplot2

Home Page:https://cran.r-project.org/package=ggimage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geom_image(): support color as an aesthetic

moldach opened this issue · comments

I filed this question on SO and it looks like there is currently no support for this function.

Could you make it possible to use color as an aesthetic in the future?
Thanks

it actually works and presented on the vignette.

Currently it only supports turning the images one color (red like the vignette). It would be useful to get multiple different color with the aes color= set according to variable.

Agreed

now it is supported.

try:

library(ggimage)
d = data.frame(x=1:10, y=1:10, type = sample(LETTERS[1:3], 10, replace=T))
ggplot(d, aes(x, y, color=type)) + geom_image()

legend key is currently not supported, and will in future.

OK, just implement a draw_key_image function to draw legend key, which internally use rectGrob.

Any idea for better presenting the legend?

image

Would be neat to use the icon as the legend

which icon is suitable?

This is similar to color text. None of the actual text is suitable to be used as legend key.

@teng-gao pls vote for it, see #18.