Here is an example. Among some dirty tricks (i.e., Multiplying the vertex size by 200), the key must use two plot commands so that we can measure the width (and height) of the labels using strwidth() , after the size of the graph is set using the first (empty ) plot.
library(igraph) camp <- graph.formula(Harry:Steve:Don:Bert - Harry:Steve:Don:Bert, Pam:Brazey:Carol:Pat - Pam:Brazey:Carol:Pat, Holly - Carol:Pat:Pam:Jennie:Bill, Bill - Pauline:Michael:Lee:Holly, Pauline - Bill:Jennie:Ann, Jennie - Holly:Michael:Lee:Ann:Pauline, Michael - Bill:Jennie:Ann:Lee:John, Ann - Michael:Jennie:Pauline, Lee - Michael:Bill:Jennie, Gery - Pat:Steve:Russ:John, Russ - Steve:Bert:Gery:John, John - Gery:Russ:Michael) V(camp)$label <- V(camp)$name set.seed(42) ## to make this reproducable co <- layout.auto(camp) plot(0, type="n", ann=FALSE, axes=FALSE, xlim=extendrange(co[,1]), ylim=extendrange(co[,2])) plot(camp, layout=co, rescale=FALSE, add=TRUE, vertex.shape="rectangle", vertex.size=(strwidth(V(camp)$label) + strwidth("oo")) * 100, vertex.size2=strheight("I") * 2 * 100)

Btw. this doesn't work very well with SVG graphics, because there is no way to measure the width of text from R, the SVG device only makes guesses.
source share