???? 在之前的推文中小編給大家展示過(guò)如何繪制散點(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
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')
p1+geom_pint(size = 4)+theme(legend.position = 'none')
emoGG包
1宏赘、安裝并加載emoGG包
remotes::install_github("dill/emoGG")
library(emoGG)
2、繪圖——基于emoGG包中的geom_emoji()函數(shù)繪制
p1+geom_emoji(emoji = "1f938")+theme(legend.position = 'none')
p1+geom_emoji(emoji = "1f48e")+theme(legend.position = 'none')
p1+geom_emoji(emoji = "1f697")+theme(legend.position = 'none')
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')
p1+geom_bernie(bernie = "stand")+theme(legend.position = 'none')
p1+geom_bernie(bernie = "head")+theme(legend.position = 'none')
p1+geom_bernie(bernie = "young")+theme(legend.position = 'none')
p1+geom_bernie(bernie = "arms")+theme(legend.position = 'none')
p1+geom_bernie(bernie = "eyebrows")+theme(legend.position = 'none')
p1+geom_bernie(bernie = "asking")+theme(legend.position = 'none')
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)
參考:
1)https://r-charts.com/miscellaneous/ggbernie/
2)https://r-charts.com/miscellaneous/geomlime/
3)https://r-charts.com/miscellaneous/ggcats/