I don't have your data, so I made some up:
df <- data.frame(x=rnorm(100),y=rnorm(100),z=rep(letters[1:4],each=25))
ggplot(df,aes(x,y)) +
geom_point() +
theme_bw() +
facet_wrap(~z)
To add a vertical line at x = 1
we can use geom_vline()
with a dataframe that has the same faceting variable (in my case z='b'
, but yours will be levels='major'
):
ggplot(df,aes(x,y)) +
geom_point() +
theme_bw() +
facet_wrap(~z) +
geom_vline(data = data.frame(xint=1,z="b"), aes(xintercept = xint), linetype = "dotted")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…