LabCanvas

Mind map in TikZ with the mindmap library, explained

Quick answer

This figure is a mind map: a large root concept, TikZ, joined by a broad, colour-shaded connection to Graphs, which branches into Trees, Mind maps, DOT syntax and Algorithms. It is a TikZ tree (\node … child { node … }) drawn with the mindmap library, which turns every node into a filled circle sized by its level and every tree edge into the organic-looking connection bar. Two keys control the layout: clockwise from sets the direction of the first child, and the level styles set sizes, fonts and the angle between siblings.

Contents

The figure and its code

A mind map: a large light blue circle labelled TikZ in big white bold letters on the left, connected by a shaded bar to a smaller dark blue circle labelled Graphs, which is connected to four small dark blue circles labelled Trees (top), Mind maps, DOT syntax and Algorithms (bottom), fanned out to the right.
Mind map (medium), typeset with TeX Live 2026 (pdfLaTeX) from the code below, exactly as it is in PacktPublishing/LaTeX-graphics-with-TikZ.
Copyright (c) 2022 Packt · MIT licence (full text). The licence asks that this notice stay with the code: keep the first lines when you reuse it.
% Mind map (medium)
% Source: https://github.com/PacktPublishing/LaTeX-graphics-with-TikZ/blob/82e099639f46ee92bc622a01c739e7f7a3e87f4b/06-drawing-trees-graphs-charts/14-medium-mind-map.tex
% Copyright (c) 2022 Packt. MIT licence: https://github.com/PacktPublishing/LaTeX-graphics-with-TikZ/blob/main/LICENSE
% The licence’s copyright and permission notice: https://www.labcanvas.com/tikz-library/credits.html
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{mindmap}
\begin{document}
\begin{tikzpicture}[
  mindmap,
  text = white,
  concept color = blue!50,
  nodes = {concept},
  root/.append style = {
    font = \Huge\sffamily\bfseries},
  level 1 concept/.append style =
    {font = \Large\sffamily, sibling angle=90},
  level 2 concept/.append style =
    {font = \normalsize\sffamily}
  ]
  \node [root] {TikZ} [clockwise from=0]
    child [concept color=blue] {
      node {Graphs} [clockwise from=90]
        child { node {Trees} }
        child { node {Mind maps} }
        child { node {DOT syntax} }
        child { node {Algorithms} }
    };
\end{tikzpicture}
\end{document}

The mindmap library

Lines 5–7 of the code

\documentclass[tikz,border=10pt]{standalone} loads TikZ and leaves a 10pt margin, and \usetikzlibrary{mindmap} loads the mind map styles. The library itself loads the trees library, which provides the circular placement keys used below, and decorations, which draws the connection bars.

Picture options: the mindmap style and its level styles

Lines 8–19 of the code

mindmap installs the whole look. In the library’s source it applies root concept to the picture (circles of at least 4 cm with text 3.5 cm wide in \large), adds level 1 concept to first-level children (2.25 cm circles at a level distance of 5 cm, 60° between siblings) and level 2 concept to the second level (1.75 cm circles, 2.9 cm away), and replaces every tree edge with a circle connection bar. text = white colours all text, concept color = blue!50 sets the colour of the root, and nodes = {concept} makes every node a concept, a circle filled and outlined in the current concept colour, so the nodes below need no options of their own.

root/.append style = {font = \Huge\sffamily\bfseries} is worth a second look: the library has no style called root (its style is root concept), so this line creates a new style that only sets the font, and \node [root] uses it. The manual recommends exactly this /.append style pattern for the level styles, after mindmap, because the mindmap style redefines fonts and sibling angles per level. Here level 1 gets a \Large sans-serif font and sibling angle=90, which has no visible effect because the root has only one child; level 2 gets \normalsize instead of the default \footnotesize.

The root and the direction of its child

Line 20 of the code

\node [root] {TikZ} [clockwise from=0] creates the root, and the options in brackets after the node’s text apply to its children. clockwise from=0, from the trees library, places the first child at 0°, straight to the right, at the level distance, and any further children at that angle minus the sibling angle, clockwise. The root is a 4 cm circle because of root concept; its huge bold label comes from the root style.

A child with its own concept colour

Lines 21–22 of the code

child [concept color=blue] { node {Graphs} … } adds the first-level concept. Because the colour is given as an option of the child operation (not of the node, and not through a level style), the library draws the connection bar with a smooth shading from the parent’s colour, the root’s blue!50, to the child’s blue. That shaded bar is the most recognisable part of TikZ mind maps. The node inside the child, node {Graphs}, is a concept thanks to nodes = {concept}, and [clockwise from=90] after it starts its own children at 90°, straight up.

Four children fanned out by the sibling angle

Lines 23–27 of the code

The four second-level children are plain child { node {Trees} } entries. With clockwise from=90 and the level-2 sibling angle of 60°, they go to 90°, 30°, −30° and −90°: Trees at the top, then Mind maps, DOT syntax and Algorithms down the right-hand side. They inherit the concept colour blue, so their connections are not shaded. The }; after the last brace ends the whole tree, which is a single path in TikZ’s eyes.

Techniques used

  • Trees with child a mind map is a TikZ tree: \node {…} child { node {…} }, with options for the children after the node.
  • Circular child placement clockwise from and sibling angle from the trees library.
  • Styles that append level 1 concept/.append style changes a library style without replacing it.
  • Diagrams mind maps among the other diagram types you can draw with TikZ.

Variations

Our own code, written for this page and typeset with TeX Live 2026 like the figure above. Each one is a complete example: copy it, or open it in the TikZ editor and change it. This code is CC0 1.0, free to use without conditions.

One colour per branch

A larger map, a thesis plan, where each branch has its own colour. Each child [concept color=teal] starts a branch, so its connection bar shades from the grey root to teal and its own children stay teal. Instead of clockwise from, grow cyclic spreads the children of every node symmetrically around the direction they came from, with sibling angle set per level.

A mind map with a grey central circle Thesis connected by shaded bars to three coloured circles: teal Methods with children DFT and MD, orange Results with children Figures and Tables, and violet Writing with children Draft and Review.
a mind map with three coloured branches; the colour changes along each first connection
Preamble: \usepackage{tikz} \usetikzlibrary{mindmap}
\begin{tikzpicture}[
    mindmap, grow cyclic, text=white, concept color=gray!70,
    every node/.append style={font=\sffamily},
    level 1/.append style={sibling angle=120},
    level 2/.append style={sibling angle=50},
  ]
  \node [concept, font=\sffamily\bfseries] {Thesis}
    % a colour on the child operation shades the connection from the old colour
    child [concept color=teal] { node [concept] {Methods}
      child { node [concept] {DFT} }
      child { node [concept] {MD} } }
    child [concept color=orange!90!black] { node [concept] {Results}
      child { node [concept] {Figures} }
      child { node [concept] {Tables} } }
    child [concept color=violet] { node [concept] {Writing}
      child { node [concept] {Draft} }
      child { node [concept] {Review} } };
\end{tikzpicture}
Open in the TikZ editor
Full document
A complete file you can compile as it is.
\documentclass[border=4pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\begin{document}
\begin{tikzpicture}[
    mindmap, grow cyclic, text=white, concept color=gray!70,
    every node/.append style={font=\sffamily},
    level 1/.append style={sibling angle=120},
    level 2/.append style={sibling angle=50},
  ]
  \node [concept, font=\sffamily\bfseries] {Thesis}
    % a colour on the child operation shades the connection from the old colour
    child [concept color=teal] { node [concept] {Methods}
      child { node [concept] {DFT} }
      child { node [concept] {MD} } }
    child [concept color=orange!90!black] { node [concept] {Results}
      child { node [concept] {Figures} }
      child { node [concept] {Tables} } }
    child [concept color=violet] { node [concept] {Writing}
      child { node [concept] {Draft} }
      child { node [concept] {Review} } };
\end{tikzpicture}
\end{document}

The same layout without the mindmap library

Under the circles and bars, a mind map is a tree with circular growth. With only the trees library, grow cyclic, a level distance and a sibling angle per level, and edge from parent/.style for the lines, the same structure becomes a lighter concept map of rounded boxes, which fits more text.

A central box TikZ with four boxes on the diagonals, Graphs, Plots, Diagrams and Circuits, each with two smaller boxes further out: Trees and DOT, pgfplots and 3D, Flowcharts and Venn, circuitikz and Logic, joined by light blue lines.
a concept map with grow cyclic and rounded boxes, using only the trees library
Preamble: \usepackage{tikz} \usetikzlibrary{trees}
\begin{tikzpicture}[
    grow cyclic, font=\sffamily\small,
    every node/.style={draw, rounded corners, fill=blue!10, align=center},
    level 1/.style={level distance=2.7cm, sibling angle=90},
    level 2/.style={level distance=1.8cm, sibling angle=50},
    edge from parent/.style={draw, thick, blue!40},
  ]
  \node[fill=blue!25, font=\sffamily\bfseries] {TikZ}
    child { node {Graphs}
      child { node {Trees} } child { node {DOT} } }
    child { node {Plots}
      child { node {pgfplots} } child { node {3D} } }
    child { node {Diagrams}
      child { node {Flowcharts} } child { node {Venn} } }
    child { node {Circuits}
      child { node {circuitikz} } child { node {Logic} } };
\end{tikzpicture}
Open in the TikZ editor
Full document
A complete file you can compile as it is.
\documentclass[border=4pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[
    grow cyclic, font=\sffamily\small,
    every node/.style={draw, rounded corners, fill=blue!10, align=center},
    level 1/.style={level distance=2.7cm, sibling angle=90},
    level 2/.style={level distance=1.8cm, sibling angle=50},
    edge from parent/.style={draw, thick, blue!40},
  ]
  \node[fill=blue!25, font=\sffamily\bfseries] {TikZ}
    child { node {Graphs}
      child { node {Trees} } child { node {DOT} } }
    child { node {Plots}
      child { node {pgfplots} } child { node {3D} } }
    child { node {Diagrams}
      child { node {Flowcharts} } child { node {Venn} } }
    child { node {Circuits}
      child { node {circuitikz} } child { node {Logic} } };
\end{tikzpicture}
\end{document}

Frequently asked questions

How do I draw a mind map in TikZ?

Load \usetikzlibrary{mindmap}, give the picture the mindmap style and a concept color, and build a tree: \node[concept] {Root} child { node[concept] {Branch} child { node[concept] {Leaf} } };. Use clockwise from or grow cyclic to spread the branches.

How do I change the size or font of mind map concepts?

Append to the level styles after the mindmap style: level 1 concept/.append style={font=\small, minimum size=2cm}. For the root, append to root concept, or use small mindmap or large mindmap for a different overall scale.

Why is the connection between two concepts shaded?

When concept color is given as an option of the child operation, the connection bar shades from the parent’s colour to the child’s. Give the colour to the node instead, or keep the same colour, for a plain bar.

References

  1. PacktPublishing/LaTeX-graphics-with-TikZ at commit 82e0996: 06-drawing-trees-graphs-charts/14-medium-mind-map.tex (MIT licence)github.com
  2. PGF/TikZ manual, §60 Mindmap Drawing Librarytikz.dev
  3. PGF/TikZ manual, §60.3.2 Concepts in Trees (root concept, level concepts, concept color)tikz.dev
  4. PGF/TikZ manual, §76.1 Growth Functions (clockwise from, grow cyclic, sibling angle)tikz.dev
  5. PGF/TikZ manual, §21 Making Trees Grow (child, level distance, sibling distance, grow)tikz.dev
  6. PGF/TikZ manual, §21.6 Edges From the Parent Nodetikz.dev
  7. pgf source on GitHub: tikzlibrarymindmap.code.tex (the mindmap and level concept styles)github.com

The walkthrough was checked against these sources and the pictures are the code typeset with TeX Live 2026. The original figure is © Packt (code from LaTeX Graphics with TikZ by Stefan Kottwitz), under the MIT licence; the variations on this page are ours, CC0 1.0.

TikZ guides for these techniques

More figures explained

Change this figure in your browserOpen the figure or any variation in the free TikZ editor: it is typeset with TeX Live as you type, with errors pointed at their line.

Open the figure in the TikZ editor