❝本节来复现「nature communications」上的一张图;散点图+拟合曲线,图形绘制倒也简单主要是细节的调整结果仅供参考,「数据+代码已经上传VIP群,加群的观众老爷请自行下载」
❞
原文
❝Bioenergetic control of soil carbon dynamics across depth
❞
❝❞
有需要学习数据可视化的朋友欢迎加入小编2022年度VIP群,目前群内已经上传公众号文档「数据+代码约270篇」,VIP交流群(1)已经500人满员,随着内容不断增多,为了更好的创做内容现在进群需「付费149元」 年底临近「从即日起至12月底无需转发文档到朋友圈积赞,可直接已129元的价格入群」无需求请勿扰。
小编微信

关注下方公众号下回更新不迷路
淘宝店铺个性化绘图服务
❝最近有部分观众老爷找小编做个性化绘图,为了给观众老爷提供更加优质的服务;小编开通了 「淘宝店铺(R语言数据分析指南)」 ,有特殊绘图需求的欢迎关注咨询
❞
结果图
加载R包
library(tidyverse)
library(magrittr)
library(ggsci)
library(ggpubr)
library(cowplot)
library(ggpmisc)
数据清洗
df <- read_tsv("data.txt") %>%
select(2:4,"Respiration of plant-derived OC \r\n(Rplant, g C-CO2 \r\nm-2 day-1)",
"Native SOC decomposition rate \r\n(kSOC, µg C-CO2 \r\ng-1 SOC day-1)",last_col()) %>%
set_colnames(c("type","layer","plant","plant_derived","SOC","RPF")) %>%
unite(.,col="lintype",layer:type,sep="-",remove = F,na.rm = F)
绘制附图
p1 <- df %>%
ggplot(aes(plant_derived,SOC,shape=lintype,color=lintype,linetype=lintype))+
geom_point()+
geom_smooth(method = lm, formula = y ~ x,alpha=0.3,se=F)+
scale_linetype_manual(values = c("dotted","dotted","dotted","solid","solid","solid"))+
scale_color_manual(values=c("#FD7446FF","#008f39","#56B4E9","#FD7446FF","#008f39","#56B4E9"))+
scale_shape_manual(values=c(0,2,1,16,17,15))+
theme_test()+
theme(legend.title = element_blank(),
legend.key = element_blank(),
legend.text = element_text(color="black"))
绘制主图

