准备数据
如下图:
image.png
利用ggplot2进行可视化
library(igraph)
library(psych)
library(Hmisc)
library(vegan)
library(dplyr)
library(vegan)
library(reshape2)
###网络图构建
df=read.csv("data.csv")
df$Breeding.time=factor(df$Breeding.time,levels=unique(df$Breeding.time))
p2 <- ggplot(df, aes(Breeding.time,number.of.nests,group=species,col=species)) +
geom_step(aes(linetype=species),size=1)+
theme_classic()+
theme(
legend.title=element_text(size = 12),
legend.text=element_text(size = 12),
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12))+
labs(x="a",y="b")
p2
image.png
网友评论