[Tex/LaTex] Mindmap level specific child distance

mindmapstikz-pgf

Using the answer I got to this question, I have a mindmap with 6 children, each with 2-5 children of their own.

MWE:

% Author: Till Tantau
% Source: The PGF/TikZ manual
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees}

\begin{document}
\resizebox{!}{4 in}{%
   \begin{tikzpicture}
      \path[
         mindmap,
         concept color=black,
         text=white,
         grow cyclic,
         segment length=20cm
      ]
      node[concept] {Main}
      [clockwise from=0]
      child[concept color=green!50!black] {%
         node[concept] {A}
         [clockwise from=65]
         child {node[concept] {A1} }
         child {node[concept] {A2} }
         child {node[concept] {A3} }
      }  
      child[concept color=blue] {%
         node[concept] {B}
         [clockwise from=-20]
         child {node[concept] {B2} }
         child {node[concept] {B3} }
      }
      child[concept color=red] {%
         node[concept] {C}
         [clockwise from=5]
         child {node[concept] {C1} }
         child {node[concept] {C2} }
         child {node[concept] {C3} }
         child {node[concept] {C4} }
         child {node[concept] {C5} }
      }
      child[concept color=orange] {%
         node[concept] {D}
         [clockwise from=-145]
         child {node[concept] {D1} }
         child {node[concept] {D2} }
      }
      child[concept color=magenta] {%
         node[concept] {E}
         [clockwise from=-180]
         child {node[concept] {E1} }
         child {node[concept] {E2} }
         child {node[concept] {E3} }
      }
      child[concept color=brown] {%
         node[concept] {F}
         [clockwise from=-245]
         child {node[concept] {F1} }
         child {node[concept] {F2} }
         child {node[concept] {F3} }
         child {node[concept] {F4} }
      };
   \end{tikzpicture}
}
\end{document}

Output:

enter image description here

Problem:
I need the level 1 children (AF) to be farther away from the parent (MAIN) as even now, F is too close to A and F3 is overlapping with A1. Furthermore, if I want each level 1 child to have 5 or 6 children of their own, then there will be serious overlap. How do I go about increasing the sibling distance on a per child/node, or at least a per level basis.

Best Answer

You can use level distance=<length> and/or sibling angle=<value> inside level <number>/.append style to customize the distance and angle for an specific level. A complete example:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees}

\begin{document}
\resizebox{!}{4 in}{%
   \begin{tikzpicture}
      \path[
         mindmap,
         concept color=black,
         text=white,
         grow cyclic,
         segment length=20cm,
level 1/.append style={level distance=8cm,sibling angle=60},
level 2/.append style={level distance=2.5cm},
      ]
      node[concept] {Main}
      [clockwise from=0]
      child[concept color=green!50!black] {%
         node[concept] {A}
         [clockwise from=30]
         child {node[concept] {A1} }
         child {node[concept] {A2} }
         child {node[concept] {A3} }
         child {node[concept] {A4} }
         child {node[concept] {A5} }
         child {node[concept] {A6} }
      }  
      child[concept color=blue] {%
         node[concept] {B}
         [clockwise from=30]
         child {node[concept] {B1} }
         child {node[concept] {B2} }
         child {node[concept] {B3} }
         child {node[concept] {B4} }
         child {node[concept] {B5} }
         child {node[concept] {B6} }
      }
      child[concept color=red] {%
         node[concept] {C}
         [clockwise from=30]
         child {node[concept] {C1} }
         child {node[concept] {C2} }
         child {node[concept] {C3} }
         child {node[concept] {C4} }
         child {node[concept] {C5} }
         child {node[concept] {C6} }
      }
      child[concept color=orange] {%
         node[concept] {D}
         [clockwise from=30]
         child {node[concept] {D1} }
         child {node[concept] {D2} }
         child {node[concept] {D3} }
         child {node[concept] {D4} }
         child {node[concept] {D5} }
         child {node[concept] {D6} }
      }
      child[concept color=magenta] {%
         node[concept] {E}
         [clockwise from=30]
         child {node[concept] {E1} }
         child {node[concept] {E2} }
         child {node[concept] {E3} }
         child {node[concept] {E4} }
         child {node[concept] {E5} }
         child {node[concept] {E6} }
      }
      child[concept color=brown] {%
         node[concept] {F}
         [clockwise from=30]
         child {node[concept] {F1} }
         child {node[concept] {F2} }
         child {node[concept] {F3} }
         child {node[concept] {F4} }
         child {node[concept] {F5} }
         child {node[concept] {F6} }
      };
   \end{tikzpicture}
}
\end{document}

enter image description here

Related Question