I want to thank you both for your help above. I'm going to abandon my quest for a number to label substitution using VertexRenderingFunction
; because I need the labels to appear inside the yellow boxes as in:
LayeredGraphPlot[{"Tile & Marble Setter" -> "Construction Foreman",
"Construction Foreman" -> "Bricklayer",
"Stonemason" -> "Construction Foreman",
"Tile & Marble Setter" -> "Bricklayer",
"Bricklayer" -> "Tile & Marble Setter",
"Tile & Marble Setter" -> "Stonemason",
"Bricklayer" -> "Stonemason", "Stonemason" -> "Bricklayer",
"Apprentice Tile & Marble Setter" -> "Tile & Marble Setter",
"Apprentice Tile & Marble Setter" -> "Apprentice Bricklayer",
"Apprentice Tile & Marble Setter" -> "Apprentice Stonemason",
"Apprentice Bricklayer" -> "Apprentice Tile & Marble Setter",
"Apprentice Bricklayer" -> "Bricklayer",
"Apprentice Bricklayer" -> "Apprentice Stonemason",
"Apprentice Stonemason" -> "Apprentice Bricklayer",
"Apprentice Stonemason" -> "Stonemason",
"Helper/Finisher" -> "Apprentice Tile & Marble Setter",
"Helper/Finisher" -> "Apprentice Bricklayer",
"Helper/Finisher" -> "Apprentice Stonemason"},
VertexLabeling -> True,
VertexCoordinateRules -> {{3, 6}, {6, 9}, {6, 6}, {9, 6}, {3, 3}, {6,
3}, {9, 3}, {6, 0}}]
The question now becomes; how can I get single double-arrows joining:
Tile & Marble Setter <---> Bricklayer;
Bricklayer <---> Stonemason;
Apprentice Tile & Marble Setter <---> Apprentice Bricklayer;
Apprentice Bricklayer <---> Apprentice Stonemason;
in the above LayeredGraphPlot
?
Thanks again!
Answer
VertexCoordinateRules apply to elements in the absolute order given, so by leading with 2
in 2 -> 1
you need to give its coordinate first.
titles = {"Construction Foreman",
"Tile & Marble Setter",
"Bricklayer",
"Stonemason",
"Apprentice Tile & Marble Setter",
"Apprentice Bricklayer",
"Apprentice Stonemason",
"Helper/Finisher"};
LayeredGraphPlot[{2 -> 1, 3 -> 1, 4 -> 1, 2 -> 3, 3 -> 2, 2 -> 4, 3 -> 4, 4 -> 3,
5 -> 2, 5 -> 6, 5 -> 7, 6 -> 5, 6 -> 3, 6 -> 7, 7 -> 6, 7 -> 4, 8 -> 5, 8 -> 6,
8 -> 7},
VertexCoordinateRules ->
{{3, 6}, {6, 9}, {6, 6}, {9, 6}, {3, 3}, {6, 3}, {9, 3}, {6, 0}},
VertexRenderingFunction ->
(Text[Style[titles[[#2]], Background -> White] ~Rotate~ (-20 °), #] &)
]
Comments
Post a Comment