Consider the following code:
vsh[{xc_, yc_}, name_, {w_, h_}] := {LightYellow,
Rectangle[{xc - w, yc - h}, {xc + w, yc + h}],
Inset[Style[Text[name], 14, Black, Bold], {xc, yc}]};
options =
Sequence[VertexSize -> 0.1, VertexShapeFunction -> vsh,
GraphLayout -> "CircularEmbedding", ImageSize -> 350,
EdgeStyle -> Blue];
g1 = Graph[{1 -> 2, 1 -> 3, 2 -> 4, 3 -> 4}, options];
g1
The output will be a simple graph with vertex labels depicted in rectangles (as can be inferred from vsh
):
My question is: how can I encapsulate the vertex labels in circles instead? Nothing I've tried seems to be working.
Rectangle[...]
toDisk[{xc, yc}, Min[w, h]]
or use any other function ofw
andh
to control the radius. $\endgroup$ – kglr Sep 28 '12 at 0:46VertexStyle
,VertexLabels
andVertexLabelStyle
. $\endgroup$ – kglr Sep 28 '12 at 1:32