# Equivalent of RadialOutside for Graph VertexLabels

I'm creating a circular graph and want the labels to be placed on the outside of the vertices in a circular manner on the outside of the graph. I've been playing around with the Placed function, but haven't got very far. I'm looking for results similar to "RadialOutside" that's available to charts. This seems like it should be easy, but I haven't been able to get anywhere.

g = Graph[CompleteGraph[26], VertexLabels -> Table[i -> Placed["Name" , Top], {i, 26}]]


g = Graph[CompleteGraph[26],
VertexLabels -> Table[i -> Placed["Name", {{0,0},
{-Cos[Pi/2 + 2 i Pi/26], .25 - Sin[Pi/2 + 2 i Pi/26]}}], {i, 26}]]


• Great! Thank you so much! Oct 18, 2014 at 3:16
• (+1) but with ImageSize -> 900 , labels are one the vertices Oct 18, 2014 at 3:20

Not to detract from PatoCriollo's excellent answer, but just to show that there is always a "there is also...".

Furthermore, the following, to my surprise, is not as fragile as I thought it might be with respect changes in ImageSize and in the vertex count of CompleteGraph.

vc = GraphEmbedding[CompleteGraph[26]];
g = Graph[EdgeList@CompleteGraph[26],
VertexLabelStyle -> Directive[{16, Bold, "Panel"}], ImagePadding -> 20,
VertexLabels -> Table[i -> Placed["Name", .5 + Pi vc[[i]]], {i, 26}]]


gr = With[{vc = GraphEmbedding[CompleteGraph[#]]},
Graph[EdgeList@CompleteGraph[#],
VertexLabelStyle -> Directive[{16, Bold, "Panel"}],
ImagePadding -> 20, ImageSize -> #2,
VertexLabels -> Table[i -> Placed["Name", .5 + Pi vc[[i]]], {i, #}]]] &;

Row[gr[#, 300] & /@ {10, 16, 26}]


Row[gr[16, #] & /@ {200, 300, 500}]


If you don't mind having a Graphics rather than a Graph object, you can use GraphComputationGraphPropertyChart which combines a PieChart with the edges of a graph:

GraphComputationGraphPropertyChart[CompleteGraph[16],
ChartStyle -> "Rainbow",
ChartBaseStyle -> Directive[EdgeForm[], Opacity[.3]]]


Use the options LabelingFunction -> (Placed[#2[[2]], "VerticalCallout"] &) and ChartLabels -> None to get

Use CompleteGraph[32] as the first argument to get

To remove the annuli, use ChartElementFunction -> None:

 GraphComputationGraphPropertyChart[CompleteGraph[25],
ChartStyle -> "Rainbow",
ImageSize -> 450, ChartElementFunction -> None,
ChartBaseStyle -> Opacity[.5]] /.  _Disk :> {}


Use ChartLabels -> Placed[Range[25], "VerticalCallout"] to get

• How'd you find this one? It's very cool. Also presumably the layout info from here could be reinserted into a Graph object to get a Graph in the end. Jul 22, 2018 at 21:44
• @b3m2a1, i was browsing through the functions in ??GraphComputation. The name sounded interesting and it worked in my first try with a graph input.
– kglr
Jul 22, 2018 at 21:50

I like to use IGVertexMap from IGraph/M to compute label coordinates for circular embeddings.

Here's an example

IGVertexMap[
Placed["Name", {0.5 + 1.8 Normalize[#], {.5, .5}}] &,
VertexLabels -> GraphEmbedding,
IGLayoutCircle[g]
]


This is more concise (and IMO more readable) than any of the other presented solutions. Also, it does not rely on a certain vertex naming, like the accepted answer.

This is how it works:

• IGLayoutCircle creates a layout centred on {0,0} (unlike "CircularEmbedding").

• Placed["Name", {pos, epos}] will place the point epos within the label at location pos within the vertex itself. Both are given in scaled coordinates running from 0 to 1.

Here's a more complex example copied from the IGraph/M documentation:

IGVertexMap[
Function[{name, coord},
Placed[
name,
{{.5, .5}, -0.8 Normalize[coord] + {.5, .5}},
Rotate[#, Mod[ArcTan @@ coord, Pi, -Pi/2]] &
]
],
VertexLabels -> {VertexList, IGVertexProp[VertexCoordinates]},
IGLayoutCircle@ExampleData[{"NetworkGraph", "FamilyGathering"}]
]


Should you need to order vertices differently along the circle, you can use IGReorderVertices. This function preserves graph properties, which is useful if you want to also style the graph based on some properties with IGVertexMap/IGEdgeMap.