Cora Olpe
Cora Olpe

Reputation: 53

Why are the ends of my error bars not displayed?

I am trying to plot a range of values and error bars with ggplot2 with ends but they are not displaying.

I tried varying the scales and error bar width but that did not work

Here is my code

plot5 <- ggplot(alpha_cDNA, aes(x = cDNA, y = ymid, colour = mark)) + geom_point() + 
         geom_errorbar(aes(ymin = ymin, ymax = ymax), width = 0.2) + theme(axis.text.x = element_text(size = 12)) + 
         theme(axis.text.y = element_text(size =12)) + scale_color_manual(values = c("chartreuse4", "aquamarine4", "steelblue4", "orchid4", "burlywood4", "gold4", "darkolivegreen4"))

The issue is that the error bar ends (which should be width 0.2) just don't display. I've never had this problem before

enter image description here

Upvotes: 5

Views: 1801

Answers (1)

Robin Gertenbach
Robin Gertenbach

Reputation: 10796

width = 0.2 makes the whiskers 0.2 x-units wide, your x range is in the thousands, you want to increase your width by a few orders of magnitude.

Upvotes: 7

Related Questions