Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I tried now for some time to figure out how to use different sibling angles for different nodes at the same level of a mind map. The sibling angles should be customized. Here is my example:

\begin{tikzpicture}
\path[mindmap, concept color=black, text=white, level 1 concept/.append style={level distance=52mm, sibling angle=100}, level 2 concept/.append style={sibling angle=40}]
node[concept] {Parent}
[clockwise from=-40]
child[concept color=blue] {
  node[concept] {Child 2}
  [clockwise from=60]
  child {node[concept] {Grandchild 1}}
  child {node[concept] {Grandchild 2}}
  child {node[concept] {Grandchild 3}}
  child {node[concept] {Grandchild 4}}
  child {node[concept] {Grandchild 5}}
  child {node[concept] {Grandchild 6}}}
child[concept color=green!60!black] {
  node[concept] {Child 1}
  [clockwise from=0]
  child{node[concept] {Grandchild 1}}
  child{node[concept] {Grandchild 2}}
  child{node[concept] {Grandchild 3}}
  child{node[concept] {Grandchild 4}}
  child{node[concept] {Grandchild 5}}
  child{node[concept] {Grandchild 6}}
  child{node[concept] {Grandchild 7}}
  child{node[concept] {Grandchild 8}}};
\end{tikzpicture}

The sibling angle of child 1 looks ok, but I would like to change the sibling angle of child 2 to spread the grandchildren out more evenly. Anyone knows how to do that?

share|improve this question
1  
Welcome to TeX.SX! Just so you know, you can edit your question even after you've posted it. Also, it would be helpful if you could turn this into a complete minimal working example (MWE). That is, complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. –  Adam Liter Apr 3 at 4:31
    
Thanks a lot for the answers! –  Michael Apr 3 at 10:38
    
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Adam Liter Apr 3 at 14:37

2 Answers 2

Another alternative is to define the circularly even distribution of level 2.

set angles for level/.style={level 2/.append style={sibling angle=360/\the\tikznumberofchildren}},
level/.append style={set angles for level=2}

Then adjust the starting angle for grandchildren respectively to prevent overlapping of branches and grandchild nodes via [clockwise from=starting angle] where grandchild 1 always has starting angle of 0.

enter image description here

Code

\documentclass[border=10pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{calc,positioning,arrows,mindmap}

\begin{tikzpicture}
\path[mindmap, concept color=black, text=white, 
level 1 concept/.append style={level distance=60mm, sibling angle=100}, 
%level 2 concept/.append style={sibling angle=40}
set angles for level/.style={level 2/.append style={sibling angle=360/\the\tikznumberofchildren}},
level/.append style={set angles for level=2}
]

node[concept] {Parent}
[clockwise from=-40]
child[concept color=blue] {
  node[concept] {Child 2}
  [clockwise from=-8]
  child {node[concept] {Grandchild 1}}
  child {node[concept] {Grandchild 2}}
  child {node[concept] {Grandchild 3}}
  child {node[concept] {Grandchild 4}}
  child {node[concept] {Grandchild 5}}
  child {node[concept] {Grandchild 6}}
}
child[concept color=green!60!black] {
  node[concept] {Child 1}
  [clockwise from=18]
  child{node[concept] {Grandchild 1}}
  child{node[concept] {Grandchild 2}}
  child{node[concept] {Grandchild 3}}
  child{node[concept] {Grandchild 4}}
  child{node[concept] {Grandchild 5}}
  child{node[concept] {Grandchild 6}}
  child{node[concept] {Grandchild 7}}
  child{node[concept] {Grandchild 8}}};
\end{tikzpicture}

\end{document}
share|improve this answer

You can change the sibling angle of level 2 in the keywords of child 2:

\documentclass[tikz,margin=10pt]{standalone}
\usetikzlibrary{mindmap}
\begin{document}
\begin{tikzpicture}
\path[mindmap, concept color=black, text=white,
  level 1 concept/.append style={level distance=52mm, sibling angle=100},
  level 2 concept/.append style={sibling angle=40}]
node[concept] {Parent}
[clockwise from=-40]
child[concept color=blue] {
  node[concept] {Child 2}
  [clockwise from=85, level 2 concept/.append style={sibling angle=50}]
  child {node[concept] {Grandchild 1}}
  child {node[concept] {Grandchild 2}}
  child {node[concept] {Grandchild 3}}
  child {node[concept] {Grandchild 4}}
  child {node[concept] {Grandchild 5}}
  child {node[concept] {Grandchild 6}}}
child[concept color=green!60!black] {
  node[concept] {Child 1}
  [clockwise from=0]
  child{node[concept] {Grandchild 1}}
  child{node[concept] {Grandchild 2}}
  child{node[concept] {Grandchild 3}}
  child{node[concept] {Grandchild 4}}
  child{node[concept] {Grandchild 5}}
  child{node[concept] {Grandchild 6}}
  child{node[concept] {Grandchild 7}}
  child{node[concept] {Grandchild 8}}};
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.