Skip to main content
added 436 characters in body
Source Link
Verbeia
  • 34.5k
  • 10
  • 111
  • 234

You can use PieChart by creating segments for the "missing" children and styling those segments explicitly to be invisible:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

So the trick is just to map your tree data into integers representing the number of "theoretical" children the nodes at that level have. (I'm working on that bit - will update later.)

If you want a hole in the middle, then you need the SectorOrigin option:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], SectorOrigin -> {Automatic, 1}, ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

You can use PieChart by creating segments for the "missing" children and styling those segments explicitly to be invisible:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

So the trick is just to map your tree data into integers representing the number of "theoretical" children the nodes at that level have. (I'm working on that bit - will update later.)

You can use PieChart by creating segments for the "missing" children and styling those segments explicitly to be invisible:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

So the trick is just to map your tree data into integers representing the number of "theoretical" children the nodes at that level have. (I'm working on that bit - will update later.)

If you want a hole in the middle, then you need the SectorOrigin option:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], SectorOrigin -> {Automatic, 1}, ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

Source Link
Verbeia
  • 34.5k
  • 10
  • 111
  • 234

You can use PieChart by creating segments for the "missing" children and styling those segments explicitly to be invisible:

PieChart[{{12}, {6, 6}, {2, 2, 2, 6}, {1, 1, 1, 1, Style[8, Directive[EdgeForm[], Opacity[0]]]}}, SectorSpacing -> 0, ChartBaseStyle -> EdgeForm[Black], ChartStyle -> {{Darker@Purple, Purple, Lighter@Purple}}] 

enter image description here

So the trick is just to map your tree data into integers representing the number of "theoretical" children the nodes at that level have. (I'm working on that bit - will update later.)