Why Does GraphPlot mislabel Vertices from a Graph?
GraphPlot
supports inputs in several different formats. Originally, it took either a list of Rule
s or an adjacency matrix. With a rule-list input, it displays the vertex labels you would expect. But the adjacency matrix does not contain information about vertex names. Thus with a matrix input, it uses vertex indices (not names) for labelling.
In 11.3 (and probably all the way back to at least 10.0), GraphPlot
also takes Graph
expressions as input. But it handles Graph
s by converting them to a matrix (not a rule list!) first. Thus the vertex names are lost, and it will use vertex indices instead.
Workaround: convert the graph to a rule list yourself.
GraphPlot[Rule @@@ EdgeList@gph, VertexLabeling -> True,
DirectedEdges -> True, Method -> "LayeredDrawing"]