I'd like to generate multiple series on a single plot and to display the geom_errorbar for each geom_line and geom_point. Something very similar to this:
therefore I have written:
library(ggplot2)
raw_data <- data.frame(x = seq(10),
y1 = sample(x=20,size=10), # c(1.1, 2.4, 3.5, 4.1, 5.9, 6.7, 7.1, 8.3, 9.4, 10.0)
y2 = sample(x=20,size=10),
y3 = sample(x=20,size=10),
y4 = sample(x=20,size=10),
se1 = runif(n=10,min=0,max=1),
se2 = runif(n=10,min=0,max=1),
se3 = runif(n=10,min=0,max=1),
se4 = runif(n=10,min=0,max=1))
ggplot(gfg_data, aes(x, y=y1)) +
geom_point(size = 4, shape = 17) +
geom_line(aes(y = y1), color = "black") +
geom_errorbar(aes(ymax = y1 + se1,ymin = y1 - se1), colour = "black", width=0.17)
ggplot(gfg_data, aes(x, y=y2)) +
geom_point(size = 4, shape = 15) +
geom_line(aes(y = y2), color = "red") +
geom_errorbar(aes(ymax = y2 + se2,ymin = y2 - se2), colour = "red", width=0.17)
...
but it fails, can somebody please suggest a way how to write this so it would work and perhaps in a more elegant way. Thank you in advance!

