skillfed

mplhep

Matplotlib styles for HEP

mplhep v1.3.2 368.0K downloads/30d#7,192 on PyPI221
Permissive license MIT Active released

What it is and what it does

mplhep is a matplotlib extension that bundles styling presets and helper functions for producing plots that conform to High Energy Physics collaboration standards. It provides ready-made styles for CMS, ATLAS, LHCb, and ALICE experiments, allowing physicists to generate ROOT-like plots without manually configuring fonts, colors, and layout conventions. The package wraps matplotlib's styling system and adds domain-specific utilities, reducing boilerplate when preparing figures for HEP publications.

The package depends on matplotlib as its core plotting backend, numpy for numerical operations, and uhi (Universal Histogram Indexing) for histogram-specific functionality. It is actively maintained by the Scikit-HEP collaboration and has been used in multiple published HEP analyses. Installation is straightforward and adds minimal overhead—it is a pure Python wheel with no compiled dependencies.

Use it for:

  • Apply CMS, ATLAS, LHCb, or ALICE collaboration plot styles to matplotlib figures for consistency with experiment standards.
  • Generate publication-ready physics plots with correct fonts and layout conventions without manual style configuration.
  • Produce ROOT-compatible plot aesthetics in Python workflows when ROOT itself is not available or practical.
  • Standardize plot appearance across a collaboration or analysis team by importing a shared style preset.
  • Combine HEP-specific styling with custom matplotlib code for specialized physics visualizations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

mplhep provides matplotlib styling and helper functions to produce publication-ready plots following High Energy Physics collaboration standards (ROOT-like appearance for CMS, ATLAS, LHCb, ALICE).

Yes. mplhep is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a real problem for HEP researchers: conforming plots to collaboration standards with minimal effort. Low install friction and modest but stable community adoption make it a safe choice for physics plotting workflows. Install it if you are producing plots for HEP experiments or collaborations.

Install

mplhep on PyPI

pip

pip install mplhep

uv

uv add mplhep

poetry

poetry add mplhep

Installing mplhep

Before you install

Low friction: pure Python wheel with four runtime dependencies (matplotlib, numpy, uhi, mplhep-data). Active maintenance with a release 22 days ago and recent commits; 221 repository stars indicate modest but steady community engagement.

License in practice

MIT license is permissive; you can use, modify, and distribute mplhep freely in commercial or private projects with minimal restrictions.

Quickstart

pip install mplhep
import mplhep as hep
import matplotlib.pyplot as plt
plt.style.use(hep.style.CMS)
# Create plots with CMS-compatible styling

Requires Python 3.11 or later; matplotlib and numpy must be installed.

Verify before relying

  • Whether mplhep-data package is automatically installed as a dependency or must be installed separately.
  • Specific font availability (Fira Sans, Tex Gyre Heros) and whether they are bundled or require system installation.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 4 — matplotlib, mplhep-data, numpy, uhi
Maintenance actively maintained — 22 days since the last release
Last repo commit
First released
Downloads 368,011/month — #7,192 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mplhep-1.3.2-py3-none-any.whl

Framework :: MatplotlibIntended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Physics

Tags

HEP matplotlib stylingphysics plot templatesROOT-like matplotlib plotscollaboration plot standardsparticle physics visualizationscientific physics plottingATLAS CMS plot style
physics-plottingcollaboration-standardsmatplotlib-extension

More Physics packages