Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df <- data.frame(
- 'level1'=c('a', 'a', 'a', 'b', 'b', 'b', 'c', 'c'),
- 'level2'=c('AA', 'BB', 'CC', 'AA', 'BB', 'CC', 'AA', 'BB'),
- 'value'=c(12.5, 12.5, 75, 50, 25, 25, 36, 64))
- ggplot(df, aes(y=value)) +
- geom_bar(aes(fill=level1, x=0), width=.5, stat='identity') +
- geom_bar(aes(fill=level2, x=.25), width=.25, stat='identity') +
- coord_polar(theta='y')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement