У меня вопрос относительно ggplot2
и ggridges
. Я хочу построить те же экспериментальные данные XRD. Как я могу опустить первые данные в конец графика, не затрагивая третий график (см. рисунок). Вот данные.
# Data import
data_celestine <- read.table('../Data/celestine.asc')
data_barite <- read.table('../Data/barite.asc')
data_sample <- read.table('../Data/sample.asc')
# Plot
df <- data.frame(
x=data_celestine$V1,
y=c(data_sample$V2, data_celestine$V2, data_barite$V2),
samplename=c(rep('Sample', length(data_celestine$V1)), rep('Celestine',length(data_celestine$V1)), rep('Barite',length(data_celestine$V1))))
library(ggplot2)
library(ggridges)
p <- ggplot(df, aes(x,y, color=samplename))
p + geom_ridgeline(
aes(y=samplename, height=y),
fill=NA, scale=.00004, min_height=-Inf) +
theme_bw()
Большое спасибо за помощь.