How to show 2 emojis when using the geom_emoji fun

2019-07-26 23:00发布

问题:

This code below only plots one emoji in a plot. I am keen to find out if there is a method to have 2 and possibly more in one plot.

library(ggplot2)
library(emoGG)

#Example 1
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_emoji(emoji="1f337")

Here is another emoji code 1f697.

回答1:

Here's a pedestrian way of going about this.

ggplot(iris, aes(x = Petal.Width, y = Sepal.Width)) +
  theme_bw() +
  geom_emoji(data = iris[iris$Species == "setosa", ], emoji = "1f337") +
  geom_emoji(data = iris[iris$Species == "virginica", ], emoji = "1f697") +
  geom_emoji(data = iris[iris$Species == "versicolor", ], emoji = "1f63b")



标签: r ggplot2 emoji