if (FALSE) {
library(ggplot2)
ggplot(data = line_coords(x1 = 1, y1 = 1, x2 = 2, y2 = 2, width = .1)) +
geom_polygon(aes(x = x, y = y, fill = group))
ggplot(data = line_coords(x1 = rnorm(10), y1 = rnorm(10), x2 = rnorm(10),
y2 = rnorm(10), width = rnorm(10)/5)) +
geom_polygon(aes(x = x, y = y, fill = group))
}
Run the code above in your browser using DataLab