事情起因是这样的:在某个搞技群里,有人发了个11维的蜜汁微笑矩阵用来逼死密集恐惧症。
11*11蜜汁微笑矩阵
于是有人用一个[擦汗]的表情表示无语……
可是仅仅一个表情,怎么能以对等的气势怼回去呢?于是......
emoji='[擦汗]'
foriinrange(11):
print(emoji*(i+1))
11维下三角擦汗
不过考虑到这种方法只能把表情按离散整数的序列来放置,还不能在任意的连续数值处放表情。考虑到R中的ggimage包可以用图片来代替散点,于是一个思路就是画散点(曲线)图,然后用表情来代换散点。
然后,升级版的逼死密集恐惧症图形就新鲜出炉了......
正弦式笑哭
library(ggplot2)
library(ggimage)
showtext::showtext.auto(enable=T)
theme1
axis.text=element_blank(),axis.ticks=element_blank())
# 正弦曲线
x
y
df_sin
ggplot(df_sin,aes(x,y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="正弦式笑哭")+
theme1
正弦式笑哭
逻辑回归式笑哭
# sigmoid曲线
sigmoid
x
y
df_sigmoide
ggplot(df_sigmoide,aes(x,y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="逻辑回归式笑哭")+
theme1
逻辑回归式笑哭
正态分布式笑哭
# 正态密度曲线
x
y
df_norm
ggplot(df_norm,aes(x,y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="正态分布式笑哭")+
theme1
正态分布式笑哭
爱心式笑哭
# 心形曲线
t
x
y
df_heart
ggplot(df_heart,aes(x=x,y=y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="爱心式笑哭")+
theme1
爱心式笑哭
众星捧月式笑哭
# 弧形
x
r
y
df_cirle
df_cirle$z[nrow(df_cirle)]
ggplot()+
geom_emoji(data=df_cirle,mapping=aes(x=x,y=y,image='1f602',size=z))+
scale_y_continuous(limits=c(-10,12))+
scale_size_area(max_size=0.3)+
labs(x="",y="",title="众星捧月式笑哭")+
guides(size=F)+
theme1
众星捧月式笑哭
囧式笑哭
x
y
shift
x1
y1
x2
y2
df_orz
ggplot(df_orz,aes(x=x,y=y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="囧式笑哭")+
theme1
囧式笑哭
金拱门式笑哭
# 金拱门
x
y
df_m
ggplot(df_m,aes(x=x,y=y))+
geom_emoji(aes(image='1f602'))+
labs(x="",y="",title="金拱门式笑哭")+
theme1
金拱门式笑哭
四叶草式笑哭
# 四叶草
x
y
df_flower
ggplot(df_flower,aes(x,y))+
geom_line()+
geom_emoji(aes(image='1f602'))+
coord_polar()+
labs(x="",y="",title="四叶草式笑哭")+
theme1
四叶草式笑哭
万花筒式笑哭
# 万花筒式笑哭
get_circle
t
x
y
df
return(df)
}
df_circle
layer
for(iin1:layer){
df_circle
}
ggplot()+
geom_emoji(data=df_circle,aes(x,y,image='1f602'))+
scale_x_continuous(limits=c(-layer,layer))+
labs(x="",y="",title="万花筒式笑哭")+
theme1
11阶万花筒式笑哭,是不是比矩阵不知道高到哪去了
无招胜有招式笑哭
# 无招胜有招式笑哭
x
y
df_norm
ggplot(data=df_norm,mapping=aes(x,y,image='1f602'))+
geom_emoji()+
labs(x="",y="",title="无招胜有招式笑哭")+
theme1
无招胜有招式笑哭
经验证明,别随便招惹程序员。
他们不仅技术好,还很闲!
(回怼这种事,没时间也得挤出时间)
作者:真依然很拉风出处:36大数据
链接:http://www.36dsj.com/archives/102917
· END ·
领取专属 10元无门槛券
私享最新 技术干货