I would like to plot a graph in such a way that
The vertices are labeled using labels that I've given them, rather than just their number,
I can manually move the vertices around.
In the code below, A
is my 4 x 4 adjacency matrix, and People
specifies the labels that I'd like for the 4 vertices. AG
gives me a graph that accomplishes (1) but not (2). GP
gives me a graph that satisfies (2) but not (1) -- it only labels the vertices by their number. How can I accomplish both (1) and (2) simultaneously? GraphPLot
does not seem to allow for VertexLabels
as an option, so I'm at a loss here.
A = {{0, 1, 1, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}}
People = {Bob, Eric, Lucy, Liz}
AG = AdjacencyGraph[A, VertexLabels -> Table[i -> People[[i]], {i, 1, Length[People]}]]
GP = GraphPlot[AG, VertexLabeling -> True]