NatureCommunications|国沿海泥滩潮间带病毒组的生物多样性研究 (五)

图1 | 滩涂潮间带沉积物中病毒和微生物的概述。
c 潮间带沉积物中溶菌性和溶原性病毒的相对比例。箱线图显示了不同生活方式病毒的相对比例差异。箱线图中的点代表每个采样区域八个样本的平均值。箱体的中线表示12个采样区域的中位值。箱体的上下边界代表四分位范围,其中下边界对应第一个四分位数,上边界对应第三个四分位数。须线表示在第一个和第三个四分位数范围的1.5倍内的最低和最高值。差异的统计显著性使用双尾t检验确定。
以下是作图代码:

# Load required libraries
library(geojsonsf)
library(sf)
library(ggplot2)
library(RColorBrewer)
library(ggspatial)
library(cowplot)
library(tidyverse)
library(scales)
library(ggsci)
library(ggforce)
library(reshape2)
library(dplyr)
library(readxl)
library(ggpubr)
library(vegan)
library(ggpmisc)

# Read data
result2 <- read.csv('raw_data_for_figure1/culmulation_mOTU.csv')
result1 <- read.csv('raw_data_for_figure1/culmulation_PCS.csv')
result <- read.csv('raw_data_for_figure1/culmulation_vOTU.csv')

# Add 'sites' column
result$sites <- seq_len(nrow(result))
result1$sites.1 <- seq_len(nrow(result1))
result2$sites.2 <- seq_len(nrow(result2))

# Ensure column names are unique
colnames(result1) <- c("richness.1", "sd.1", "sites.1")
colnames(result2) <- c("richness.2", "sd.2", "sites.2")

# Combine data frames
all_new <- data.frame(result, result1, result2)

# Plot
ggplot(all_new) +
  geom_point(aes(x = sites.1, y = richness.1), shape = 19, size = 0.4, color = "#7AC5CD", alpha = 0.5) +
  geom_errorbar(aes(x = sites.1, ymin = richness.1 - sd.1, ymax = richness.1 + sd.1), lwd = 0.14, width = 0.7, alpha = 0.85, position = position_dodge(0),
                color = "#7AC5CD") +
  geom_point(aes(x = sites.2, y = richness.2), shape = 19, size = 0.4, color = "gray", alpha = 0.5) +
  geom_errorbar(aes(x = sites.2, ymin = richness.2 - sd.2, ymax = richness.2 + sd.2), lwd = 0.14, width = 0.7, alpha = 0.85, position = position_dodge(0),
                color = "gray") +
  geom_point(aes(x = sites, y = richness), shape = 19, size = 0.4, color = "#FF9B64", alpha = 0.5) +
  geom_errorbar(aes(x = sites, ymin = richness - sd, ymax = richness + sd), lwd = 0.14, width = 0.85, alpha = 0.7, position = position_dodge(0),
                color = "#FF9B64") +
  labs(x = "# of samples", y = "Cumulative number") +
  theme_test() +
  theme(panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        axis.title.x = element_text(size = 6.5),
        axis.title.y = element_text(size = 7),
        axis.text.x = element_text(hjust = 0.5, size = 6, colour = 'black'),
        axis.text.y = element_text(size = 6, colour = 'black'),
        axis.ticks = element_line(linewidth = 0.3),
        axis.ticks.length = unit(0.04, "cm"),
        panel.border = element_rect(linewidth = 0.35)) +
  scale_x_continuous(limits = c(0, 100), breaks = seq(0, 100, 20)) + ylim(0, 10000)

作图结果:

image.png

看没看懂都点个赞呗~

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容