# TikZ physics examples

> Physics figures drawn in TikZ and pgfplots, with code: Bloch sphere, Maxwell–Boltzmann and Bose–Einstein plots, an Otto cycle, a Feynman diagram and more.

URL: https://www.labcanvas.com/tikz/examples/physics

Eighteen physics figures, almost all from Janosh Riebesell’s *diagrams* collection. The largest group is statistical and thermal physics: the Maxwell–Boltzmann speed distribution, ideal and van der Waals isotherms, an Otto cycle on a p–V diagram, critical temperature curves, spontaneous magnetisation, gas pressure on a wall and the Bose–Einstein distribution in 3D. There are also a Bloch sphere, scattering and detailed balance, Thomson scattering, four solid-state figures (a k-space lattice of states, the Seebeck effect, basis plus lattice equals crystal, a ferroelectric response), three field-theory sketches and a helicopter free-body diagram.

Seven of the figures are plots made with pgfplots, the plotting package built on TikZ. The Feynman diagram uses the TikZ-Feynman package and the Seebeck figure loads circuitikz; the others are plain TikZ with libraries such as `calc`, `angles`, `quotes` and `decorations.markings`.

## Quantum & particles

- **Bloch sphere** (Quantum & particles): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/bloch-sphere/bloch-sphere.tex. Code: https://www.labcanvas.com/tikz-library/code/bloch-sphere.tex
- **Scattering and detailed balance** (Quantum & particles): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/scattering-detailed-balance/scattering-detailed-balance.tex. Code: https://www.labcanvas.com/tikz-library/code/scattering-and-detailed-balance.tex

## Statistical & thermal

- **Bose–Einstein distribution (3D)** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/bose-einstein-distribution-3d/bose-einstein-distribution-3d.tex. Code: https://www.labcanvas.com/tikz-library/code/bose-einstein-distribution-3d.tex
- **Critical temperature curves** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/critical-temperature/critical-temperature.tex. Code: https://www.labcanvas.com/tikz-library/code/critical-temperature-curves.tex
- **Gas pressure on a wall** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/gas-pressure-on-wall/gas-pressure-on-wall.tex. Code: https://www.labcanvas.com/tikz-library/code/gas-pressure-on-a-wall.tex
- **Ideal and van der Waals isotherms** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/isotherms/isotherms.tex. Code: https://www.labcanvas.com/tikz-library/code/ideal-and-van-der-waals-isotherms.tex
- **Maxwell–Boltzmann speed distribution** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/maxwell-boltzmann-distribution/maxwell-boltzmann-distribution.tex. Code: https://www.labcanvas.com/tikz-library/code/maxwell-boltzmann-speed-distribution.tex
- **Otto cycle (p–V diagram)** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/otto-cycle/otto-cycle.tex. Code: https://www.labcanvas.com/tikz-library/code/otto-cycle-p-v-diagram.tex
- **Spontaneous magnetisation** (Statistical & thermal): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/spontaneous-magnetization/spontaneous-magnetization.tex. Code: https://www.labcanvas.com/tikz-library/code/spontaneous-magnetisation.tex

## Waves & optics

- **Thomson scattering** (Waves & optics): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/thomson-scattering/thomson-scattering.tex. Code: https://www.labcanvas.com/tikz-library/code/thomson-scattering.tex

## Mechanics

- **Helicopter free-body diagram** (Mechanics): MIT licence, © Devin Taylor. Source: https://github.com/Devin-Taylor/TikZ/blob/8ae35d243e702b17307f75905e23b63068c690e8/helicopter_fbd/helicopter.tex. Code: https://www.labcanvas.com/tikz-library/code/helicopter-free-body-diagram.tex

## Solid state & materials

- **k-space lattice of states** (Solid state & materials): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/k-space/k-space.tex. Code: https://www.labcanvas.com/tikz-library/code/k-space-lattice-of-states.tex
- **Seebeck effect (thermoelectric)** (Solid state & materials): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/seebeck-effect/seebeck-effect.tex. Code: https://www.labcanvas.com/tikz-library/code/seebeck-effect-thermoelectric.tex
- **Basis plus lattice equals crystal** (Solid state & materials): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/basis-plus-lattice/basis-plus-lattice.tex. Code: https://www.labcanvas.com/tikz-library/code/basis-plus-lattice-equals-crystal.tex
- **Ferroelectric response** (Solid state & materials): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/ferroelectric-response/ferroelectric-response.tex. Code: https://www.labcanvas.com/tikz-library/code/ferroelectric-response.tex

## Field theory

- **Feynman diagram with a loop** (Field theory): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/feynman-diagram-loop/feynman-diagram-loop.tex. Code: https://www.labcanvas.com/tikz-library/code/feynman-diagram-with-a-loop.tex
- **M-theory and its limits** (Field theory): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/m-theory/m-theory.tex. Code: https://www.labcanvas.com/tikz-library/code/m-theory-and-its-limits.tex
- **RG flow in theory space** (Field theory): MIT licence, © Janosh Riebesell and contributors. Source: https://github.com/janosh/diagrams/blob/7a79b3114e201fad9b6785e936eab859d1bc8c12/assets/rg-flow-in-theory-space/rg-flow-in-theory-space.tex. Code: https://www.labcanvas.com/tikz-library/code/rg-flow-in-theory-space.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
