- Code: Select all
VertexLabels -> Placed["Name",Tooltip]
According to the documentation you can also apply your own formatting function f to the label, by providing f as a third argument to Placed. However, in the examples with VertexLabels, the vertex labels in that case are forced to some constant, rather than using "Name" to have the formatting function applied to the vertices as defined in the graph. That is, the code looks like
- Code: Select all
Placed["xxx",Center,rotateLabel]
- Code: Select all
Placed["Name",Center,rotateLabel]
A cumbersome way out seems to be to enumerate all vertices and explicitly define the labels in the VertexLabels option as the vertex itself, like
- Code: Select all
Graph[vertices,VertexLabels->Map[#->Placed[rotateLabel[#],Center]&,vertices]
By the way,
- Code: Select all
Graph[vertices,VertexLabels->Map[#->Placed[#,Center,rotateLabel]&,vertices]
In my application, the vertices are actually permutations in the form of lists of numbers.
Are these shortcomings of Mathematica, or am I doing something wrong?
Thanks,
Tom
