Hi, I would like to add error bars to demonstrate the standard deviation of the data in my two datasets in one plot.
Please see current code below:
ggplot() +
geom_path(TPL_c1_Biomarker_data_compiled, mapping = aes(x = Avg_d13C_n, y = depth_m, xmin = Avg_d13C_n-Stdev_avg, xmax = Avg_d13C_n+Stdev_avg, color = "d13Cc1")) +
geom_point(TPL_c1_Biomarker_data_compiled, mapping = aes(x = Avg_d13C_n, y = depth_m, xmin = Avg_d13C_n-Stdev_avg, xmax = Avg_d13C_n+Stdev_avg, color = "d13Cc1")) +
geom_path(TPL_c2_Biomarker_data_compiled, mapping = aes(x = Avg_d13C_n, y = depth_m, xmin = Avg_d13C_n-Stdev_avg, xmax = Avg_d13C_n+Stdev_avg, color = "d13Cc2")) +
geom_point(TPL_c2_Biomarker_data_compiled, mapping = aes(x = Avg_d13C_n, y = depth_m, xmin = Avg_d13C_n-Stdev_avg, xmax = Avg_d13C_n+Stdev_avg, color = "d13Cc2")) +
scale_y_reverse(breaks = c(0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7)) +
geom_errorbarh() +
xlab("n-alkane d13C column 1 & column 2") +
ylab("Depth (m)") +
theme_classic() +
scale_color_manual("",
breaks = c("d13Cc1", "d13Cc2"),
values = c("d13Cc1" = "purple", "d13Cc2" = "green"))