Bug introduced in 9.0.1 or earlier and persisting through 11.0.1 or later
Recently I found the following TreePlot
issue. For simplicity, I took an example from Mathematica Tree Drawing Tutorial and set TreePlot
orientation to Left
:
TreePlot[{1 -> 4, 1 -> 5, 2 -> 8, 3 -> 4, 4 -> 8, 6 -> 8, 7 -> 8, 7 -> 9}, Left,
VertexRenderingFunction -> ({EdgeForm[Black], Yellow, Disk[#1, 0.2],
Black, Text[#2, #1]} &)]
But when I specified the root node to 5
(which differs from an automatically selected root node 4
), I recieved an image with stretched verticies:
TreePlot[{1 -> 4, 1 -> 5, 2 -> 8, 3 -> 4, 4 -> 8, 6 -> 8, 7 -> 8, 7 -> 9}, Left, 5,
VertexRenderingFunction -> ({EdgeForm[Black], Yellow, Disk[#1, 0.2],
Black, Text[#2, #1]} &)]
Is there a generic solution to this problem? Thanks.