I have a ggplot of three trajectories (unique values in the variable column is three) with confidence intervals.
This is my plot:
ggplot(df, aes(x=time, y=value, group=variable, color=variable, stroke=1.5))+
geom_rect(aes(xmin = -Inf,xmax = 7,ymin = -Inf, ymax = Inf),
fill="#DAEAF1",
alpha = .2)+
geom_vline(xintercept=7)+
stat_summary(geom="ribbon", fun.data=mean_cl_normal, width=0.1, conf.int=0.95)+
stat_summary(geom="line", fun.y=mean, linetype="dashed")+
stat_summary(geom="point", fun.y=mean, shape=8, size=1)
and the head of df is:
X time variable value
1 1 0.00 M 0.1507799
2 2 0.33 M 0.1254237
3 3 1.00 M 0.3680203
4 4 3.00 M 0.6286472
5 5 7.00 M 0.7751938
6 6 7.33 M 0.7857143
Now suppose I have multiple of dfs --> df1, df2, df3 and I want to show these ggplots stacked in a 3d plot. How can I do that in R? I want something like this link but with ggplot so it looks nicer--> How can I make 3d plot with stacked 2d plot?