How to show 2 emojis when using the geom_emoji function (related to ggplot)?

风流意气都作罢 提交于 2019-12-24 06:41:38

问题


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")



来源:https://stackoverflow.com/questions/40355540/how-to-show-2-emojis-when-using-the-geom-emoji-function-related-to-ggplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!