1

I have a quite simple question. Lets consider I have data like that:

plouf <- data.frame(x = 1:10, y = 1:10 + 1:10*0.1, y_min = 1:10/2, y_max = (1:10)^2)

If I plot it:

library(ggplot2)
ggplot(plouf,aes(x,y))+
  geom_point()+
  geom_errorbar(aes(ymin = y_min, ymax = y_max))

I get thisenter image description here

I would like to keep a linear scale, and zoom in to see the points :

ggplot(plouf,aes(x,y))+
  geom_point()+
  geom_errorbar(aes(ymin = y_min, ymax = y_max))+
  ylim(0,20)

enter image description here

But here I don't see the error bars. I would like to display the truncated error bars, to show that the error is bigger than the scale displayed here, and to show the lower value of the error bar.

How can I achieve this ?

denis
  • 5,580
  • 1
  • 13
  • 40

0 Answers0