data visualization - Connected bubble chart in R -
i have following:
type <- c('a', 'b', 'c', 'a&b', 'a&c', 'b&c', 'a&b&c') distribution <- c(.25, .1, .12, .18, .15, .05, .15)
i create bubble chart 1 shown in selected answer question: proportional venn diagram more 3 sets bubble areas proportional values in distribution vector , connecting lines show relationship between 3 main bubbles 'a', 'b', , 'c'.
using igraph
library data, create edges , vertices represent desired plot. here's 1 way it
library(igraph) type <- c('a', 'b', 'c', 'a&b', 'a&c', 'b&c', 'a&b&c') distribution <- c(.25, .1, .12, .18, .15, .05, .15) mx <- strsplit(type,"&") ei <- sapply(mx,length)>1 cx <- do.call(rbind, mapply(cbind, type[ei], mx[ei])) gg <- graph.edgelist(cx, directed=false) v(gg)[type]$size<-distribution *200 plot(gg)
and plot got
Comments
Post a Comment