小提琴图(一)


#载入vioplot包

library("vioplot")

#定义需要绘制的变量数据

x1 <-read.delim("C:/Users/Administrator/Desktop/j.txt")

View(x1)

x2 <- as.matrix(x1)

x3=scale(x2)

x4 <- read.delim("C:/Users/Administrator/Desktop/k.txt")

View(x4)

x5 <- as.matrix(x4)

x6=scale(x5)

x7 <- read.delim("C:/Users/Administrator/Desktop/l.txt")

View(x7)

x8 <- as.matrix(x7)

x9=scale(x8)

x10 <- read.delim("C:/Users/Administrator/Desktop/m.txt")

View(x10)

x11 <- as.matrix(x10)

x12=scale(x11)

x13 <- read.delim("C:/Users/Administrator/Desktop/n.txt")

View(x13)

x14 <- as.matrix(x13)

x15=scale(x14)

x16 <- read.delim("C:/Users/Administrator/Desktop/o.txt")

View(x16)

x17 <- as.matrix(x16)

x18=scale(x17)

x19 <- read.delim("C:/Users/Administrator/Desktop/p.txt")

View(x19)

x20 <- as.matrix(x19)

x21=scale(x20)

x22 <- read.delim("C:/Users/Administrator/Desktop/r.txt")

View(x22)

x23 <- as.matrix(x22)

x24=scale(x23)

x25 <- read.delim("C:/Users/Administrator/Desktop/s.txt")

View(x25)

x26 <- as.matrix(x25)

x27=scale(x26)

x28 <- read.delim("C:/Users/Administrator/Desktop/t.txt")

View(x28)

x29 <- as.matrix(x28)

x30=scale(x29)

x31 <- read.delim("C:/Users/Administrator/Desktop/u.txt")

View(x31)

x32 <- as.matrix(x31)

x33=scale(x32)

x34 <- read.delim("C:/Users/Administrator/Desktop/v.txt")

View(x34)

x35 <- as.matrix(x34)

x36=scale(x35)

x37 <- read.delim("C:/Users/Administrator/Desktop/w.txt")

View(x37)

x38 <- as.matrix(x37)

x39=scale(x38)

x40 <- read.delim("C:/Users/Administrator/Desktop/x.txt")

View(x40)

x41 <- as.matrix(x40)

x42=scale(x41)

x43 <- read.delim("C:/Users/Administrator/Desktop/y.txt")

View(x43)

x44 <- as.matrix(x43)

x45=scale(x44)

x46 <- read.delim("C:/Users/Administrator/Desktop/z.txt")

View(x46)

x47 <- as.matrix(x46)

x48=scale(x47)

#绘制小提琴图

vioplot(x3,x6,x9,x12,x15,x18,x21,x24,x27,x30,x33,x36,x39,x42,x45,x48,names=c("cg","yf","yyf","ef","eyf","f","gen","zj","zz","bm","gc","bsz","yp","zl","js","dy"),col="green")

title("Violin Plot of  Stipagrostis pennata")

> #小提琴图中的白色的点表示中位数,黑色的框表示IQR,细黑线表示须,小提琴的胖瘦表示分布密度

所做图形如下所示:

降落

你可能感兴趣的:(小提琴图(一))