# Mind map in TikZ with the mindmap library, explained

> How a mind map is drawn with the TikZ mindmap library: concept nodes, concept colours, level styles, clockwise from, and two variations to copy.

URL: https://www.labcanvas.com/tikz/examples/diagrams/mind-map-medium

Updated 2026-11-22. Original figure: Mind map (medium), © Packt (code from LaTeX Graphics with TikZ by Stefan Kottwitz), MIT licence (licence text: https://www.labcanvas.com/tikz-library/credits.html#packt), from https://github.com/PacktPublishing/LaTeX-graphics-with-TikZ/blob/82e099639f46ee92bc622a01c739e7f7a3e87f4b/06-drawing-trees-graphs-charts/14-medium-mind-map.tex. Walkthrough and variations by LabCanvas; the variation code is CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/). Pictures typeset with TeX Live 2026 and PGF 3.1.12. Category: [TikZ diagram examples: flowcharts, mind maps, Venn](https://www.labcanvas.com/tikz/examples/diagrams).

## 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.

## 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.](https://www.labcanvas.com/tikz-snippets/fig-mind-map-medium/original.webp)

Copyright (c) 2022 Packt, MIT licence (https://www.labcanvas.com/tikz-library/credits.html#packt). The code below is exactly the library's file (pdfLaTeX); its first lines name the source and the licence, and the MIT licence asks that they stay with the code. Open it in the TikZ editor from the page: https://www.labcanvas.com/tikz/examples/diagrams/mind-map-medium

```latex
% 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](https://www.labcanvas.com/tikz/trees): a mind map is a TikZ tree: `\node {…} child { node {…} }`, with options for the children after the node.
- [Circular child placement](https://www.labcanvas.com/tikz/trees): `clockwise from` and `sibling angle` from the trees library.
- [Styles that append](https://www.labcanvas.com/tikz/libraries): `level 1 concept/.append style` changes a library style without replacing it.
- [Diagrams](https://www.labcanvas.com/tikz/diagrams): mind maps among the other diagram types you can draw with TikZ.

## Variations

Our own code, CC0 1.0, each typeset with TeX Live 2026 in a standalone document with the preamble lines shown.

### 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.](https://www.labcanvas.com/tikz-snippets/fig-mind-map-medium/branch-colours.webp)

*a mind map with three coloured branches; the colour changes along each first connection*

Preamble: `\usepackage{tikz}`, `\usetikzlibrary{mindmap}`

```latex
\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}
```

### 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.](https://www.labcanvas.com/tikz-snippets/fig-mind-map-medium/plain-tree.webp)

*a concept map with grow cyclic and rounded boxes, using only the trees library*

Preamble: `\usepackage{tikz}`, `\usetikzlibrary{trees}`

```latex
\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}
```

## 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

- [PacktPublishing/LaTeX-graphics-with-TikZ at commit 82e0996: 06-drawing-trees-graphs-charts/14-medium-mind-map.tex (MIT licence)](https://github.com/PacktPublishing/LaTeX-graphics-with-TikZ/blob/82e099639f46ee92bc622a01c739e7f7a3e87f4b/06-drawing-trees-graphs-charts/14-medium-mind-map.tex)
- [PGF/TikZ manual, §60 Mindmap Drawing Library](https://tikz.dev/library-mindmaps)
- [PGF/TikZ manual, §60.3.2 Concepts in Trees (root concept, level concepts, concept color)](https://tikz.dev/library-mindmaps#sec-60.3.2)
- [PGF/TikZ manual, §76.1 Growth Functions (clockwise from, grow cyclic, sibling angle)](https://tikz.dev/library-trees#sec-76.1)
- [PGF/TikZ manual, §21 Making Trees Grow (child, level distance, sibling distance, grow)](https://tikz.dev/tikz-trees)
- [PGF/TikZ manual, §21.6 Edges From the Parent Node](https://tikz.dev/tikz-trees#sec-21.6)
- [pgf source on GitHub: tikzlibrarymindmap.code.tex (the mindmap and level concept styles)](https://github.com/pgf-tikz/pgf/blob/master/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex)

## TikZ guides for these techniques

- [TikZ trees: child syntax, forest and tikz-qtree](https://www.labcanvas.com/tikz/trees): Draw trees in LaTeX: TikZ child syntax with level and sibling distance, forest for automatic spacing, tikz-qtree, org charts, binary and decision trees.
- [TikZ diagrams: block, cycle, flowchart, tree and more](https://www.labcanvas.com/tikz/diagrams): How to draw diagrams in TikZ: block, cycle, flowchart, tree, graph, timeline, matrix, commutative and circuit diagrams, each with compiled code.
- [TikZ libraries: what each one adds and how to load it](https://www.labcanvas.com/tikz/libraries): Reference table of TikZ libraries (positioning, calc, arrows.meta, shapes, decorations, patterns, fit, matrix…) with load lines, examples and manual links.
- [TikZ graphs: drawing networks of vertices and edges](https://www.labcanvas.com/tikz/graphs): Graph theory drawings in TikZ: vertices and edges by hand, directed and weighted graphs, loops, the \graph syntax, K_n and C_n, and automatic layouts.
