I assume you get the following error message:
'opts' is deprecated. Use 'theme' instead. (Deprecated; last used in version 0.9.1)
theme_rect is deprecated. Use 'element_rect' instead. (Deprecated; last used in version 0.9.1)
If so, this should be stated in your question.
Using the current version of ggplot2 (0.9.3.1) and theme()
instead of opts()
, this script:
ggplot(data = dat, aes(x = item, y = value, ymin = 0, ymax = value)) +
geom_point(colour = "blue") +
geom_linerange(colour = "blue") +
facet_wrap(~draw, ncol = 5) +
scale_y_continuous(lim = c(0, 1)) +
theme_bw() +
theme(panel.border = element_rect(colour = "black"))
...gives this plot:
Is this what you want?
You may also wish to check the scales
argument in ?facet_wrap
, and coord_cartesian
as an alternative to set limits in scale_y_continuous