R可視化——拓展:個(gè)性散點(diǎn)圖繪制

???? 在之前的推文中小編給大家展示過如何繪制散點(diǎn)圖,今天,小編給大家展示的內(nèi)容是對(duì)之前散點(diǎn)圖的一部分拓展——將散點(diǎn)圖中的散點(diǎn)換成俏皮可愛的圖案。當(dāng)然,這種圖案雖然有趣,對(duì)于日常組會(huì)匯報(bào)可能有點(diǎn)用,但科研論文發(fā)表一定慎用,畢竟學(xué)術(shù)還是要以嚴(yán)謹(jǐn)為主。

基礎(chǔ)散點(diǎn)圖繪制

#加載R包
library(ggplot2)
#繪圖——數(shù)據(jù)以iris數(shù)據(jù)集為例
p1<-ggplot(iris,aes(Sepal.Length,Sepal.Width,color=Species))+
geom_point()+
theme_bw()
p1
image.png

geomlime包

1、安裝并加載geomlime包
remotes::install_github("coolbutuseless/geomlime")
library(geomlime)
2、繪圖——基于geomlime包中的geom_lime()和geom_pint()函數(shù):
p1+geom_lime(size = 4)+theme(legend.position = 'none')
image.png
p1+geom_pint(size = 4)+theme(legend.position = 'none')
image.png

emoGG包

1、安裝并加載emoGG包
remotes::install_github("dill/emoGG")
library(emoGG)
2、繪圖——基于emoGG包中的geom_emoji()函數(shù)繪制
p1+geom_emoji(emoji = "1f938")+theme(legend.position = 'none')
image.png
p1+geom_emoji(emoji = "1f48e")+theme(legend.position = 'none')
image.png
p1+geom_emoji(emoji = "1f697")+theme(legend.position = 'none')
image.png

ggbernie包

1、安裝并加載ggbernie包
remotes::install_github("R-CoderDotCom/ggbernie")
library(ggbernie)
2、繪圖——基于ggbernie包中的geom_bernie()函數(shù)繪制
p1+geom_bernie(bernie = "sitting")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "stand")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "head")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "young")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "arms")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "eyebrows")+theme(legend.position = 'none')
image.png
p1+geom_bernie(bernie = "asking")+theme(legend.position = 'none')
image.png

ggcats包

1、安裝并加載ggcats包
remotes::install_github("R-CoderDotCom/ggcats@main")
library(ggcats)
2、繪圖——基于ggcats包中的geom_cat()函數(shù)繪制
a<-ggplot(iris,aes(Sepal.Length,Sepal.Width))+
  geom_cat(cat = "shironeko", size = 2)+
  theme_bw()
b<-ggplot(iris,aes(Sepal.Length,Sepal.Width))+
  geom_cat(cat = "bongo", size = 2)+
  theme_bw()
c<-ggplot(iris,aes(Sepal.Length,Sepal.Width))+
  geom_cat(cat = "pop", size = 2)+
  theme_bw()
d<-ggplot(iris,aes(Sepal.Length,Sepal.Width))+
  geom_cat(cat = "toast", size = 2)+
  theme_bw()
cowplot::plot_grid(a,b,c,d,ncol = 2)
image.png
參考:

1)https://r-charts.com/miscellaneous/ggbernie/
2)https://r-charts.com/miscellaneous/geomlime/
3)https://r-charts.com/miscellaneous/ggcats/

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容