# Lets make some data
lines <- data.frame(
x = c(5, 12, 15, 9, 6),
y = c(17, 20, 4, 15, 5),
xend = c(19, 17, 2, 9, 5),
yend = c(10, 18, 7, 12, 1),
width = c(1, 10, 6, 2, 3),
colour = letters[1:5]
)
ggplot() + geom_link(aes(x = x, y = y, xend = xend, yend = yend,
colour = colour, alpha = ..index..,
size = ..index..),
data = lines)
ggplot() + geom_link2(aes(x = x, y = y, colour = colour, size = width,
group = 1),
data = lines, lineend = 'round', n = 500)
Run the code above in your browser using DataLab