--- id: mplhep version: "1.3.2" license: MIT license_treatment: permissive maintenance: active --- # mplhep — Matplotlib styles for HEP License: permissive · Maintenance: active · Downloads: 368.0K/mo ## 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 above — 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 pip install mplhep uv add mplhep 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_current - Install friction: low - Maintenance: active - Downloads: 368.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags HEP matplotlib styling, physics plot templates, ROOT-like matplotlib plots, collaboration plot standards, particle physics visualization, scientific physics plotting, ATLAS CMS plot style, physics-plotting, collaboration-standards, matplotlib-extension [View on SkillFed](https://skillfed.io/packages/mplhep) · [View on PyPI](https://pypi.org/project/mplhep/)