|||
效果 图
----------------------------------
原始数据csv文件数据录入方式一例
# step 1 导入数据到R软件
mean.sd <- read.csv("~/mean.sd.csv")
View(mean.sd)
#-------- 双误差棒 图片绘制 Example s tart--------------------------------
# add both x- and y-axis errorbars
#参考 https://www.plob.org/article/7521.html
#-----step 2 先定义双轴误差棒的函数 ,R代码如下----
plot.error.xy <- function(x,y,sdx,sdy,len = 1, col = "black") {
len <- len * 0.05
arrows(x0 = x, y0 = y, x1 = x, y1 = y - sdy, col = col, angle = 90, length = len)
arrows(x0 = x, y0 = y, x1 = x, y1 = y + sdy, col = col, angle = 90, length = len)
arrows(x0 = x, y0 = y, x1 = x - sdx, y1 = y , col = col, angle = 90, length = len)
arrows(x0 = x, y0 = y, x1 = x + sdx, y1 = y, col = col, angle = 90, length = len)
}
#----------Function finished ------
# step 3 作图,xy轴范围和xy轴label内容等,就不一一举例了
# step 4 加误差误差棒
#-----------Example finished--------------------------------
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 19:23
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社