6

I was just trying to use a tikz mindmap, but there is a problem. I can't figure out how to set the two children of node (1) left and right. There is always the 60° spacing between them, I want them to be separated by 180°.

I tried level distance, grow=left and right etc. but nothing worked. I do not want change the whole child order, just the one for the node at the top.

Here is my code:

\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{mindmap,trees}

\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
  \path[mindmap,concept color=black,text=white]
    node[concept] {\normalsize{Reibungsreduktion am Ventiltrieb}}
    [clockwise from=30]
    child[concept color=blue] {
      node[concept] {5}
      [clockwise from=60]
      child { node[concept] {\scriptsize{a}} }
      child { node[concept] {\scriptsize{b} }}
      child { node[concept] {\scriptsize{c} }}
    }
    child[concept color=blue] {
      node[concept] {4}
      [clockwise from=0]
      child { node[concept] {\scriptsize a} }
      child { node[concept] {\scriptsize{b} } }
      child { node[concept] {\scriptsize{c}} }
    }
    child[concept color=blue] {
      node[concept] {3}
      [clockwise from=-60]
      child { node[concept] {\scriptsize{a} }}
      child { node[concept] {\scriptsize{b} }}
      child { node[concept] {\scriptsize{c} }}
    }  
    child[concept color=blue] {
      node[concept] {2}
      [clockwise from=240]
      child { node[concept] {\scriptsize{a}} }
      child { node[concept] {\scriptsize{b}} }
    }
    child[concept color=blue] {
      node[concept] {6}
      [clockwise from=240]
      child { node[concept] {\scriptsize{a}} }
      child { node[concept] {\scriptsize{b}} }
    }
    child[concept color=blue] {
      node[concept] {1}
      [clockwise from=0]
      child { node[concept] {\scriptsize{a}} }
      child { node[concept] {\scriptsize{b} }}
    };
\end{tikzpicture}
\end{document}
  • 1
    Welcome to TeX - LaTeX! Code should be indented with 4 spaces; you can achieve this by marking the code and then pressing the {} icon above the edit box. – Andrew Swann Apr 10 '16 at 15:11
  • 1
    ahhhh. alright, thanks! Any idea about the mindmap? How to arrange the nodes? I'm just not getting it... :/ – Manu Apr 10 '16 at 15:59
5

Add [main/.style={sibling angle=180}] to your tikzpicture like this:

\begin{tikzpicture}[main/.style={sibling angle=180}]

Then you can write the part with the node 1 like:

...

child[concept color=blue] {
    node[concept] {1}
        [clockwise from =0]
    child[main] { node[concept] {\scriptsize{a}} }
    child[main] { node[concept] {\scriptsize{b} }}
};

...

And here's the result:

enter image description here

0

I humbly offer a small alternative:

child[grow=0] { node {a} }
child[grow=180] { node {b }}

together with

\begin{tikzpicture}[
        every node/.append style={concept},
        level 2 concept/.append style={node font=\scriptsize}]

which allows you not to have to specify each node as concept and not to have to specify scriptsize every time you're in a level 2 node.

Here's the complete code:

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\begin{document}
\begin{tikzpicture}[
  every node/.append style={concept},
 level 2 concept/.append style={node font=\scriptsize}]
 \path[mindmap,concept color=black,text=white]
 node {\normalsize{Reibungsreduktion am Ventiltrieb}}
 [clockwise from=30]
 child[concept color=blue] {
  node {5}
  [clockwise from=60]
  child { node {a} }
  child { node {b}}
  child { node {c}}
 }
 child[concept color=blue] {
  node {4}
  [clockwise from=0]
  child { node {a} }
  child { node {b} }
  child { node {c} }
 }
 child[concept color=blue] {
  node {3}
  [clockwise from=-60]
  child { node {a}}
  child { node {b}}
  child { node {c}}
 }  
 child[concept color=blue] {
  node {2}
  [clockwise from=240]
  child { node {a} }
  child { node {b} }
 }
 child[concept color=blue] {
  node {6}
  [clockwise from=240]
  child { node {a} }
  child { node {b} }
 }
 child[concept color=blue] {
  node {1}
  child[grow=0] { node {a} }
  child[grow=180] { node {b}}
 };
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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