I would like to create black outlines around my errorbars in order to get especially the white errorbar better visible (see attached code below).
I would be very grateful if anyone could help me (If of any help I can send the whole code & dput to the person who responds).
REPRODUCIBLE EXAMPLE
# DATA:
structure(list(damage = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L), .Label = c("C", "L1", "L4"), class = "factor"), 
leaf = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
4L, 4L, 5L, 5L, 5L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
4L, 4L, 5L, 5L, 5L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
4L, 4L, 5L, 5L, 5L), .Label = c("Cot", "L1", "L2", "L3", 
"L4"), class = "factor"), cor_average = c(587.6666667, 595.3333333, 
858, 2361.666667, 2880, 2760, 2338.333333, 2006.666667, 3296.666667, 
3660.333333, 2765, 3752, 3927.333333, 3705, 4636.666667, 
742.5, 605, 520, 1974, 2408, 2494, 2102.333333, 2470, 2701, 
3336.666667, 3737, 4529.666667, 4850, 4293.333333, 4972, 
487.5, 645, 623.3333333, 1998.333333, 2016.666667, 1971.666667, 
2520, 2532.333333, 2181.666667, 3720, 4275, 4389, 5625, 6303.333333, 
4783.666667)), .Names = c("damage", "leaf", "cor_average"
), class = "data.frame", row.names = c(NA, -45L))
#CODE
data <- read.csv("Example.csv",sep=",",header=T)
library(ggplot2)
summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,
                  conf.interval=.95, .drop=TRUE) {
library(plyr)
 length2 <- function (x, na.rm=FALSE) {
    if (na.rm) sum(!is.na(x))
   else       length(x)
   }
   datac <- ddply(data, groupvars, .drop=.drop,
               .fun = function(xx, col) {
                 c(N    = length2(xx[[col]], na.rm=na.rm),
                   mean = mean   (xx[[col]], na.rm=na.rm),
                   sd   = sd     (xx[[col]], na.rm=na.rm)
                 )
               },
               measurevar
   )
   datac <- rename(datac, c("mean" = measurevar))
   datac$se <- datac$sd / sqrt(datac$N)  
   ciMult <- qt(conf.interval/2 + .5, datac$N-1)
   datac$ci <- datac$se * ciMult
   return(datac)
 }
CI <- summarySE(data, measurevar="cor_average", 
                groupvars=c("damage","leaf"))
CI
data$leaf <- ordered(data$leaf, levels = c("L4", "L3", "Cot","L1", "L2"))
pd <- position_dodge(0.4)
ggplot(CI, aes(x=leaf, y=cor_average, colour=damage)) +
  geom_errorbar(aes(ymin=cor_average-ci, ymax=cor_average+ci),
                width=.4, size=1.2,position=pd) +
  geom_line(position=pd) +
  scale_colour_manual(values=c("white","black","gray65"))+
  geom_point(position=pd,size=4.4)+
  labs(x="Leaf",y="Average nr. glands corrected for leaf sz.")+
  theme(axis.text=element_text(size=13),
        axis.title=element_text(size=16,face="bold"))+
  theme(legend.text = element_text(size=14),
        legend.title = element_text(size=14))
 
    