小伙伴说要画一个简单的带误差线的折线图,graphpad用不了,我琢磨一下,可以用R语言。本段代码是探究不同处理条件,伤口面积随着时间的变化,通过Rmisc包summarySE函数,得出图片如下:
Rplot.png
setwd("~/Desktop/190603")
getwd()
library("ggplot2")
install.packages("Rmisc")
library("Rmisc")
woundarea <- read.csv("~/Desktop/190603/WoundArea3.csv",header = TRUE, stringsAsFactors = TRUE)
head(woundarea)
View(woundarea)
tgc <- summarySE(woundarea, measurevar="woundarea", groupvars=c("sample","days"))
tgc
#带有标准误差线的折线图
ggplot(tgc, aes(x=days, y=woundarea, colour=sample)) +
geom_errorbar(aes(ymin=woundarea-se, ymax=woundarea+se), width=.1) +
geom_line() +
geom_point()
网友评论