library(reshape2)
library(ggplot2)
library(ggridges)
xqt <- read.csv("TE1.csv",header = T) #导入数据
data1=melt(xqt) #宽数据变成长数据
head(data1)
tail(data1)
ggplot(data1, aes(x = data1$value, y = data1$variable, fill = ..density..)) + #这里y为样品,x为value
geom_density_ridges_gradient(scale = 3, rel_min_height = 0.00,size = 0.3) + #不用改
scale_fill_gradient2(low="Aquamarine",mid="LightGoldenrod1",high = "HotPink",midpoint = 1.0)+theme_bw()+xlim(0,+2.0) #手动配色
scale_fill_gradientn(colours = colorRampPalette(rev(brewer.pal(11,'Spectral')))(32))+theme_test() #自动配色(可选)
网友评论