# TikZ commutative diagram examples

> Commutative diagrams drawn with TikZ, with code: universal properties and a diagram of thermodynamic potentials and their Legendre transforms.

URL: https://www.labcanvas.com/tikz/examples/commutative-diagrams

Three diagrams: a universal property, the universal property of the tensor product (both from Martin Thoma) and the thermodynamic ensembles with the transforms between their potentials (from Janosh Riebesell). All three are drawn with plain TikZ nodes and arrows rather than with the tikz-cd package.

For new commutative diagrams, tikz-cd is usually simpler: you type the objects in a matrix and the arrows between them. See the [commutative diagrams guide](https://www.labcanvas.com/tikz/commutative-diagrams).

## Commutative diagrams

- **Thermodynamic ensembles and transforms** (Commutative diagrams): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/thermo-ensemble-trafos/thermo-ensemble-trafos.tex. Code: https://www.labcanvas.com/tikz-library/code/thermodynamic-ensembles-and-transforms.tex
- **Commutative diagram: universal property** (Commutative diagrams): MIT licence, © Martin Thoma. Source: https://github.com/MartinThoma/LaTeX-examples/blob/f9236c5fe5d47f19822fcb11097df27355562314/tikz/commutative-diagram-2/commutative-diagram-2.tex. Code: https://www.labcanvas.com/tikz-library/code/commutative-diagram-universal-property.tex
- **Tensor product universal property** (Commutative diagrams): MIT licence, © Martin Thoma. Source: https://github.com/MartinThoma/LaTeX-examples/blob/f9236c5fe5d47f19822fcb11097df27355562314/tikz/tensor-diagram/tensor-diagram.tex. Code: https://www.labcanvas.com/tikz-library/code/tensor-product-universal-property.tex

## Using these figures

Every figure keeps its own licence: MIT or CC0 1.0, both of which allow use, change and sharing, commercial use included. The MIT licence asks that its copyright and permission notice go with copies of the code, so each figure’s code starts with its source, author and licence; keep those lines when you reuse it. The full licence texts are on the [sources and licences page](https://www.labcanvas.com/tikz-library/credits.html).

“Open in the TikZ editor” loads the figure’s complete document into the free TikZ editor, where it is typeset with TeX Live 2026 and you can change it and download a PNG. To compile it on your own computer, save the code as a.tex file and run pdfLaTeX (or the engine the tile names) on it; LabCanvas changed the files only where needed to make each one compile on its own, as its first lines say.

Licence texts: https://www.labcanvas.com/tikz-library/credits.html
