8

I have some doubts regarding mindmaps. I am following the next templates:

Scientific interactions

Computer science mindmap

I do not seem to be able to interchange the 2 codes. The two main problems I am facing are:

1- make child nodes for the children like in the 2nd link, in particular 2 for 'a3' and 3 for 'b3'.

2- make gradient colors for the edges like in the 2nd link.

I also feel like 'c' should be a child of 'a' instead of a different scope, since they are connected, which takes me to problem 1. A plus would be to rearrange the whole network to make it look more beautiful (with fewer edge crossings) and smaller (less height, in particular), with shorter edges.

Please check the MWE below, any help would be really appreciated. Thanks!

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=25cm,paperheight=22cm,left=1cm,top=1cm]{geometry}

\usetikzlibrary{mindmap,trees,backgrounds}

\pagestyle{empty}

\begin{document}



    \begin{tikzpicture}[mindmap,
     level 1 concept/.append style={level distance=130,sibling angle=30}]
     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black, scale=0.375] (a) {a}[clockwise from=-10] 
        child {node [concept, scale=0.6] (a1) {a1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (a2) {a2}}
        child {node [concept, scale=0.6] (a3) {a3}}
        child {node [concept, scale=0.6] (a4) {a4}}
        child {node [concept, scale=0.6] (a5) {a5}}
        child {node [concept, ball color=green!25!black, scale=0.6] (a6) {a6}};
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black, scale=0.375] (b) at ([xshift=2cm,yshift=3cm]a.east) {b}[clockwise from=50]
        child {node [concept, ball color=green!25!black, scale=0.6] (b1) {b1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (b2) {b2}}
        child {node [concept, scale=0.6] (b3) {b3}}
        child {node [concept, scale=0.6] (b4) {b4}};
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, scale=0.375] (c) at ([xshift=-2cm,yshift=2cm]a.east) {c}[clockwise from=180]
        child {node [concept, scale=0.6] (c1) {c1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (c2) {c2}}
        child {node [concept, ball color=green!25!black, scale=0.6] (c3) {c3}};
     \end{scope}

     \begin{pgfonlayer}{background}
     \draw [circle connection bar]
        (a4) edge (a5)
        (a1) edge (b)
        (a1) edge (b4)
        (a6) edge (b)
        (a) edge (c)
        (a5) edge (c)
        (b1) edge (c)
        (c1) edge (c3)
        (b1) edge (c);
     \end{pgfonlayer}

    \end{tikzpicture}

\end{document}

It produces the following:

MWE

2 Answers 2

6
  1. Nest child {node {}} constructs where required; I produced two children for a3 and three for b3, as requested.

  2. You can use

    circle connection bar switch color=from (<start color>) to (<endcolor>)
    

    see the paths at the end of my exmaple code.

The code:

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=25cm,paperheight=22cm,left=1cm,top=1cm]{geometry}
\usetikzlibrary{mindmap,trees,backgrounds}

\pagestyle{empty}

\begin{document}

    \begin{tikzpicture}[mindmap,
     level 1 concept/.append style={level distance=130,sibling angle=30}]
     \begin{scope}[mindmap, concept color=gray,circle connection bar switch color=from (red) to (blue)]
     \node [concept, ball color=red!50!black, scale=0.375] (a) {a}[clockwise from=-10] 
        child {node [concept, scale=0.6] (a1) {a1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (a2) {a2}}
        child {node [concept, scale=0.6] (a3) {a3}
                     child {node[concept,scale=0.4]  (a31) {a31}}
                     child {node[concept,scale=0.4]  (a32) {a32}}
        }
        child {node [concept, scale=0.6] (a4) {a4}}
        child {node [concept, scale=0.6] (a5) {a5}}
        child {node [concept, ball color=green!25!black, scale=0.6] (a6) {a6} 
        };
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black, scale=0.375] (b) at ([xshift=2cm,yshift=3cm]a.east) {b}[clockwise from=50]
        child {node [concept, ball color=green!25!black, scale=0.6] (b1) {b1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (b2) {b2}}
        child {node [concept, scale=0.6] (b3) {b3}
                child {node[concept,scale=0.4]  (b31) {b31}}
                child {node[concept,scale=0.4]  (b32) {b32}}
                child {node[concept,scale=0.4]  (b33) {b33}}
         }
        child {node [concept, scale=0.6] (b4) {b4}};
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, scale=0.375] (c) at ([xshift=-2cm,yshift=2cm]a.east) {c}[clockwise from=180]
        child {node [concept, scale=0.6] (c1) {c1}}
        child {node [concept, ball color=green!25!black, scale=0.6] (c2) {c2}}
        child {node [concept, ball color=green!25!black, scale=0.6] (c3) {c3}};
     \end{scope}

     \begin{pgfonlayer}{background}
     \path [circle connection bar]
        (a4) edge (a5)
        (a1) edge (b)
        (a1) edge (b4)
        (a6) edge (b)
        (a) edge (c)
        (a5) edge (c)
        (b1) edge (c)
        (c1) edge (c3)
        (b1) edge (c);
     \end{pgfonlayer}
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b2);
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b1);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a2);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a6);

    \end{tikzpicture}

\end{document}

enter image description here

I propose here some modifications:

  1. Use a small mindmap instead of those scaling factors and enlarge the font (this I say for experience: reading the font with your original settings was a torture).

  2. Change the position of some of the children; this improves a lot the aspect, since you can avoid some many crossing connectors; in particular the grow=<angle> option for child can be really useful here (see a6 and c2 in the code below).

The modified code:

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=23cm,paperheight=22cm,left=1cm,top=1cm]{geometry}
\usetikzlibrary{mindmap,trees,backgrounds}

\pagestyle{empty}

\begin{document}

    \begin{tikzpicture}[small mindmap,every node/.append style={font=\large},
     level 1 concept/.append style={level distance=130,sibling angle=30}]
     \begin{scope}[mindmap, concept color=gray,circle connection bar switch color=from (red) to (blue)]
     \node [concept, ball color=red!50!black] (a) {a}[clockwise from=-10] 
        child {node [concept] (a1) {a1}}
        child {node [concept, ball color=green!25!black] (a2) {a2}}
        child {node [concept] (a3) {a3}
                     child {node[concept]  (a31) {a31}}
                     child {node[concept]  (a32) {a32}}
        }
        child {node [concept] (a4) {a4}}
        child {node [concept] (a5) {a5}}
        child[grow=75] {node [concept, ball color=green!25!black] (a6) {a6} 
        };
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black] (b) at ([xshift=3cm,yshift=2cm]a.east) {b}[clockwise from=50]
        child {node [concept, ball color=green!25!black] (b1) {b1}}
        child {node [concept, ball color=green!25!black] (b2) {b2}}
        child {node [concept] (b3) {b3}
                child {node[concept]  (b31) {b31}}
                child {node[concept]  (b32) {b32}}
                child {node[concept]  (b33) {b33}}
         }
        child {node [concept] (b4) {b4}};
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept] (c) at ([xshift=-3cm,yshift=6cm]a.east) {c}[clockwise from=180]
        child {node [concept] (c1) {c1}}
        child[grow=45] {node [concept, ball color=green!25!black] (c2) {c2}}
        child {node [concept, ball color=green!25!black] (c3) {c3}};
     \end{scope}

     \begin{pgfonlayer}{background}
     \path [circle connection bar]
        (a4) edge (a5)
        (a1) edge (b)
        (a1) edge (b4)
        (a6) edge (b)
        (a) edge (c)
        (a5) edge (c)
        (b1) edge (c)
        (c1) edge (c3)
        (b1) edge (c);
     \end{pgfonlayer}
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b2);
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b1);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a2);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a6);

    \end{tikzpicture}

\end{document}

The result:

enter image description here

And a variation in which c is a child of a (you'll have to decide whether this is the case or not):

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=23cm,paperheight=22cm,left=1cm,top=1cm]{geometry}
\usetikzlibrary{mindmap,trees,backgrounds}

\pagestyle{empty}

\begin{document}

    \begin{tikzpicture}[small mindmap,every node/.append style={font=\large},
     level 1 concept/.append style={level distance=130,sibling angle=30}]
     \begin{scope}[mindmap, concept color=gray,circle connection bar switch color=from (red) to (blue)]
     \node [concept, ball color=red!50!black] (a) {a}[clockwise from=-10] 
        child {node [concept] (a1) {a1}}
        child {node [concept, ball color=green!25!black] (a2) {a2}}
        child {node [concept] (a3) {a3}
                     child {node[concept]  (a31) {a31}}
                     child {node[concept]  (a32) {a32}}
        }
        child {node [concept] (a4) {a4}}
        child {node [concept] (a5) {a5}}
        child[grow=120] {node[concept] (c) {c}
            child {node [concept] (c1) {c1}}
           child[grow=45] {node [concept, ball color=green!25!black] (c2) {c2}}
           child {node [concept, ball color=green!25!black] (c3) {c3}}
            }
        child[grow=55] {node [concept, ball color=green!25!black] (a6) {a6} 
        };
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black] (b) at ([xshift=4cm,yshift=2cm]a.east) {b}[clockwise from=50]
        child[grow=110] {node [concept, ball color=green!25!black] (b1) {b1}}
        child {node [concept, ball color=green!25!black] (b2) {b2}}
        child {node [concept] (b3) {b3}
                child {node[concept]  (b31) {b31}}
                child {node[concept]  (b32) {b32}}
                child {node[concept]  (b33) {b33}}
         }
        child {node [concept] (b4) {b4}};
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
%     \node [concept] (c) at ([xshift=-3cm,yshift=6cm]a.east) {c}[clockwise from=180]
%        child {node [concept] (c1) {c1}}
%        child[grow=45] {node [concept, ball color=green!25!black] (c2) {c2}}
%        child {node [concept, ball color=green!25!black] (c3) {c3}};
     \end{scope}

     \begin{pgfonlayer}{background}
     \path [circle connection bar]
        (a4) edge (a5)
        (a1) edge (b)
        (a1) edge (b4)
        (a6) edge (b)
        (a) edge (c)
        (a5) edge (c)
        (b1) edge (c)
 %       (c1) edge (c3)
        (b1) edge (c);
     \end{pgfonlayer}
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b2);
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b1);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a2);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a6);

    \end{tikzpicture}

\end{document}

enter image description here

Adding a solid (i.e., not shaded) color for selected connection bars seems not to be as immediate as I thought; in the following example I defined a connection bar color key allowing to assign solid colors (although one could use circle connection bar switch color=from (<color>) to (<color>) but this could be computationally heavy since behind the scenes it is a shading):

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=23cm,paperheight=22cm,left=1cm,top=1cm]{geometry}
\usetikzlibrary{mindmap,trees,backgrounds}

\pagestyle{empty}

\begin{document}

    \begin{tikzpicture}[small mindmap,every node/.append style={font=\large},
     level 1 concept/.append style={level distance=130,sibling angle=30},
     connection bar color/.style={every circle connection bar/.append style={
            append after command={[fill=#1]}}}]
     \begin{scope}[mindmap, concept color=gray,circle connection bar switch color=from (red) to (blue)]
     \node [concept, ball color=red!50!black] (a) {a}[clockwise from=-10] 
        child {node [concept] (a1) {a1}}
        child {node [concept, ball color=green!25!black] (a2) {a2}}
        child {node [concept] (a3) {a3}
                     child {node[concept]  (a31) {a31}}
                     child {node[concept]  (a32) {a32}}
        }
        child {node [concept] (a4) {a4}}
        child {node [concept] (a5) {a5}}
        child[grow=120] {node[concept] (c) {c}
            child {node [concept] (c1) {c1}}
           child[grow=45] {node [concept, ball color=green!25!black] (c2) {c2}}
           child {node [concept, ball color=green!25!black] (c3) {c3}}
            }
        child[grow=55] {node [concept, ball color=green!25!black] (a6) {a6} 
        };
     \end{scope}

     \begin{scope}[mindmap, concept color=gray]
     \node [concept, ball color=red!50!black] (b) at ([xshift=4cm,yshift=2cm]a.east) {b}[clockwise from=50]
        child[grow=110] {node [concept, ball color=green!25!black] (b1) {b1}}
        child {node [concept, ball color=green!25!black] (b2) {b2}}
        child {node [concept] (b3) {b3}
                child {node[concept]  (b31) {b31}}
                child {node[concept]  (b32) {b32}}
                child {node[concept]  (b33) {b33}}
         }
        child {node [concept] (b4) {b4}};
     \end{scope}


    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b2);
    \path 
        (b) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (b1);
    \path 
        (a) to[circle connection bar switch color=from (red!80!black) to (green!85!black)] (a2);
\begin{scope}[circle connection bar,connection bar color=cyan!70!black]
    \path 
        (a4) to (a5);
    \path 
        (a1) to (b);
    \path 
        (a1) to (b4);
\end{scope}        
    \path 
        (a6) to (b);
\begin{scope}[circle connection bar,connection bar color=orange!70!black]
    \path 
        (a5) to (c);
    \path 
        (b1) to (c);
    \path 
        (c1) to (c3);
    \path 
        (b1) to (c);
\end{scope}        
    \path 
        (a) to[circle connection bar,connection bar color=yellow!70!black] (a3);
    \path 
        (a) to[circle connection bar,connection bar color=magenta!70!black] (a4);
    \end{tikzpicture}

\end{document}

enter image description here

5
  • Many many thanks! and sorry for the small font. Exactly what I was looking for with a great distribution. Just a quick question, since I can specify the edges with the paths at the end, I can create the extra edges the same way and remove the whole \begin{pgfonlayer}{background} block, right? Then how could I color the edges just gray? I will play around... Thanks!
    – DaniCee
    Commented May 21, 2014 at 13:53
  • @DaniCee You're welcome! I just updated my answer adding an option in which c is a child of a. Regarding your question, I have to leave now in a hurry but in some hours I'll answer it. Commented May 21, 2014 at 13:58
  • Thanks again Gonzalo, really complete answer! As for the last question, one might think that "circle connection bar switch color=gray" or "circle connection bar color=gray" would work... I will leave it as "circle connection bar switch color=from (gray) to (gray)" for the moment, since I don't find anything better. Thanks again!
    – DaniCee
    Commented May 21, 2014 at 14:05
  • Another thing that I'm trying to do is rotate the whole network, I'm trying this en.wikibooks.org/wiki/LaTeX/Rotations with no success...
    – DaniCee
    Commented May 21, 2014 at 15:10
  • @DaniCee I've updated my answer showing how to assign colors to selected connection bars. Regarding the rotation, using \rotatebox from the graphicx package does the job. If you experience any difficulties, I'd suggest you to open a fresh new question. Commented May 21, 2014 at 18:30
3

Another proposal. This solution makes c a child of a and children for a3 and b3 ared added. Also, a concept color=blue, text=black is defined for the parents node so that the gradient effect can be seen when a child has its own concept color (see child a3, b3 and c). You may want to remove the ball color=<some color> commands for a different possibility to explore. Note: clockwise from=40 controls the first child node to start from 40 degree CW while sibling angle=30 controls the sepration among children.

enter image description here

Code

\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=25cm,paperheight=22cm,left=1cm,top=1cm]{geometry}
\usetikzlibrary{mindmap,trees,backgrounds}
\pagestyle{empty}

\begin{document}
\begin{tikzpicture}
\path[mindmap, concept color=blue, text=black, 
level 1 concept/.append style={level distance=130,sibling angle=30},
level 2 concept/.append style={text=black,sibling angle=40}
]

node [concept, scale=0.375,ball color=red!50!black] (a) {a}[clockwise from=-30] 
        child {node [concept, scale=0.6] (a1) {a1}}
        child {node [concept, scale=0.6, ball color=green!25!black] (a2) {a2}}
%
        child [concept color=red]{node[concept, scale=0.6]  (a3) {a3}[clockwise from=-70]
        child {node [concept, scale=0.6] (a31) {a31}}
        child {node [concept, scale=0.6] (a32) {a32}}
}
        child {node [concept, scale=0.6] (a4) {a4}}
        child {node [concept, scale=0.6] (a5) {a5}}
        child {node [concept, scale=0.6, ball color=green!25!black] (a6) {a6}}
%
        child[concept color=green] {node [scale=0.6,concept,ball color=red!50!black] (c) at ([xshift=-3cm,yshift=3cm]a.east) {c}[clockwise from=180]
        child {node [concept, scale=0.6] (c1) {c1}}
        child {node [concept, scale=0.6,ball color=green!25!black,text=yellow] (c2) {c2}} 
%
        child {node [concept, scale=0.6, ball color=green!25!black,text=yellow] (c3) {c3}} 
%
}
node [concept, scale=0.375,ball color=red!50!black] (b) at ([xshift=2cm,yshift=3cm]a.east) {b}[clockwise from=40]
        child {node [concept, scale=0.6, ball color=green!25!black] (b1) {b1}}
%
        child {node [concept, scale=0.6, ball color=green!25!black] (b2) {b2}}
%
        child[concept color=green] {node [concept, scale=0.6] (b3) {b3}[clockwise from=20]
        child {node [concept, scale=0.6] (b31) {b31}}
        child {node [concept, scale=0.6] (b32) {b32}}
        child {node [concept, scale=0.6] (b33) {b33}}
}
        child {node [concept, scale=0.6] (b4) {b4}};

     \begin{pgfonlayer}{background}
     \draw [circle connection bar]
        (a4) edge (a5)
        (a1) edge (b)
        (a1) edge (b4)
        (a6) edge (b)
        (a) edge (c)
        (a5) edge (c)
        (b1) edge (c)
        (c1) edge (c3)
        (b1) edge (c);
     \end{pgfonlayer}
    \end{tikzpicture}
\end{document}
1
  • Thanks! I will explore this approach too, but will accept Gonzalo's answer mainly for the distribution. Thanks!
    – DaniCee
    Commented May 21, 2014 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .