Hello,

i use ggplot to plot some measures including CIs as horizontal errorbars. I get an error when the scale limits are narrower than the boundaries of the error bar and hence the CIs are not plotted.

library(ggplot2)
df <- data.frame(resp=c(1,2), k=c(1,2), se=c(1,2))

ggplot(df, aes(resp,y=k)) +  geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se)) +   scale_x_continuous(limits=c(-1,3))

Is there a way to plot the errorbars anyway? Setting xmax to the scale limit is not so good, I guess, because you couldn't determine whether the CI is wider than the scale limits or not.

Thanks a lot,
Best,
Felix



Dr. rer. nat. Dipl.-Psych. Felix Fischer
Institut für Sozialmedizin, Epidemiologie und Gesundheitsökonomie
Charité - Universitätsmedizin Berlin
Luisenstrasse 57
10117 Berlin

Tel: 030 450 529 104
Fax: 030 450 529 902
http://epidemiologie.charite.de<http://epidemiologie.charite.de/>


	[[alternative HTML version deleted]]

