如何在使用geom_emoji函数(与ggplot相关)时显示2个emojis? [英] How to show 2 emojis when using the geom_emoji function (related to ggplot)?

查看:181
本文介绍了如何在使用geom_emoji函数(与ggplot相关)时显示2个emojis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的这段代码只绘制了一个情节中的一个表情符号。我很想知道是否有方法在一个情节中有2个或更多。

  library(ggplot2)
library(emoGG)

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



这是另一个表情符号代码 1f697 $ b $ div class =h2_lin>解决方案

这是一个行人的方式。

  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)


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.

解决方案

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

这篇关于如何在使用geom_emoji函数(与ggplot相关)时显示2个emojis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆