I have two graphs I made with the package ggplot2 with standard deviation like this:
( pplot_1 <- ggplot(data=data, aes(x=data$Group, y=data$Data_1))
+ stat_summary(fun.data = mean_sdl, fun.args = list(mult = 1), geom = "errorbar", aes(width=0.05))
+ stat_summary(fun.y = mean, geom = "line", color='red')
+ xlab("X-Axis")
+ ylab("Y-Axis")
)
( pplot_2 <- ggplot(data=data, aes(x=data$Group, y=data$Data_2))
+ stat_summary(fun.data = mean_sdl, fun.args = list(mult = 1), geom = "errorbar", aes(width=0.05))
+ stat_summary(fun.y = mean, geom = "line", color='red')
+ xlab("X-Axis")
+ ylab("Y-Axis")
)
Example:
myTable <- "ID Data_1 Data_2 Group
1 -50 -100 5.0
2 -44 -101 5.0
3 -48 -99 5.0
4 -50 -80 4.9
5 -44 -81 4.9
6 -48 -82 4.9
7 -48 -79 4.9
8 -44 -40 4.8
9 -49 -45 4.8
10 -48 -44 4.8
11 -60 -35 4.8
10 -50 -2 4.7
11 -80 0 4.7
Data <- read.table(text=myTable, header = TRUE)
I want to plot them into one graph and manually change the scale of the axes to show the difference between them and their standard deviation over time (x-axis).