22

In tikz's mindmap, I want to change the concept size for individual parents or children (not the entire system). It is simply possible to increase the size of a child node, by introducing minimum size into the concept options.

How to decrease the size of a single concept, as tikz does not support maximum size?

Googlebot
  • 4,035

2 Answers2

24

You can decide to scale nodes for example by setting:

\tikzset{every node/.append style={scale=0.6}}

and then locally redefine the scaling just in the node you are interested in.

For example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\tikzset{level 1 concept/.append style={font=\sf, sibling angle=90,level distance = 25mm}}
\tikzset{level 2 concept/.append style={font=\sf, sibling angle=45,level distance = 15mm}}
\tikzset{level 3 concept/.append style={font=\sf, sibling angle=45,level distance = 15mm}}
\tikzset{every node/.append style={scale=0.6}}

\begin{document}
\begin{tikzpicture}[mindmap, concept color=blue, font=\sf\bf, text=white]
\node[concept]{Root Concept}[clockwise from=315]
                        child[concept color=orange] {node[concept] (c1){Child 1}                                
                                    child [concept color=orange]  {node [concept](c11){Child 1-1}}
                                    child [concept color=orange] {node [concept](c12){Child 1-2}}
                                    child [concept color=orange] {node [concept](c13){Child 1-3}}                                                   
                        }
                        child [concept color=orange] {node [concept](c2){Child 2}
                                    child [concept color=orange] {node [concept,scale=0.4](c21){Child 2-1}}
                                    child [concept color=orange] {node [concept](c22){Child 2-2}}
                                    child [concept color=orange] {node [concept](c22){Child 1-3}}
                        };
\end{tikzpicture}
\end{document}

will give you:

enter image description here

Notice the local redefinition in:

child [concept color=orange] {node [concept,scale=0.4](c21){Child 2-1}}
  • Is there any way to change the scale of all the nodes at a given level k? If I add 'scale=0.2' to the level 2 concept style something very bad happens... – Antonio Sesto Dec 03 '15 at 13:39
  • 1
    @AntonioSesto: you can try \tikzset{level 2 concept/.append style={font=\sf, sibling angle=45,level distance = 25mm,scale=0.6,transform shape}}. Basically the trick is to add transform shape for the labels and increase the distance that the scaling option reduces. – Claudio Fiandrino Dec 03 '15 at 13:42
1

I think it is better to locally change the font size rather than changing the scale

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node[circle,draw,minimum size=3em,text width=3em](a) at (0,0){aaaa};
\begin{scope}\small
\node[circle,draw,minimum size=3em,text width=3em](b) at (4,1){aaaa aaaaa};
\end{scope}
\draw(a) -- (b);
\end{tikzpicture}
\end{document}

enter image description here

rpapa
  • 12,350