## The key glyph for sankey diagrams can be applied to different geoms as well.
## In the example below it is applied to a histogram
library(ggplot2)
ggplot(data.frame(x = rnorm(100), groups = rep(letters[1:2], 2)),
aes(x = x, fill = groups)) +
geom_histogram(key_glyph = draw_key_sankeyedge, binwidth = 0.2, alpha = 1)
ggplot(data.frame(x = rnorm(100), groups = rep(letters[1:2], 2)),
aes(x = x, fill = groups)) +
geom_histogram(key_glyph = draw_key_sankeynode, binwidth = 0.2)
Run the code above in your browser using DataLab