I have a plot drawn with the following command:
ggplot(data=test_mod, aes(x=realDist , y=1-value, color=as.factor(foo) , size=as.factor(foo) )) +
stat_summary(fun.y=mean, geom="line", alpha=0.85 ) +
stat_summary(fun.y=mean, geom="point", pch=21, fill="white", size=2 ) +
#stat_summary(fun.data=mean_cl_normal, geom="errorbar", width=8, size = 0.5) +
theme_bw(base_size = 15, base_family = "Palatino") +
theme(legend.key = element_blank())
And I get this legend:
However, when I uncomment the line 3 of the command:
ggplot(data=test_mod, aes(x=realDist , y=1-value, color=as.factor(foo) , size=as.factor(foo) )) +
stat_summary(fun.y=mean, geom="line", alpha=0.85 ) +
stat_summary(fun.y=mean, geom="point", pch=21, fill="white", size=2 ) +
stat_summary(fun.data=mean_cl_normal, geom="errorbar", width=8, size = 0.5) +
theme_bw(base_size = 15, base_family = "Palatino") +
theme(legend.key = element_blank())
I get a slightly different legend:
Note the tiny lines which go across the dots after I started using errorbar
for my plot.
How can I get rid of those tiny lines appearing in my legend?