mplhep-data

0.0.5 · active · verified Tue Apr 14

mplhep-data is a font (data) sub-package for `mplhep`, providing several common High Energy Physics fonts like Tex Gyre Termes and Latin Modern. It is currently at version 0.0.5 and appears to have an infrequent release cadence focused on adding new fonts or maintenance. It acts as a data provider, making these fonts available for `mplhep` styles rather than offering a direct Python API for users.

Warnings

Install

Imports

Quickstart

A basic `mplhep` plot demonstrating style application. When `mplhep-data` is installed, `mplhep` automatically gains access to its provided fonts, which are used by styles like `ATLAS` or `CMS` for correct rendering and consistent font usage across platforms.

import matplotlib.pyplot as plt
import mplhep as hep

# mplhep-data is implicitly used by mplhep for its font assets.
# Ensure mplhep-data is installed for full font support in mplhep styles.

plt.style.use(hep.style.ATLAS) # Or hep.style.CMS, hep.style.LHCb, etc.

fig, ax = plt.subplots()
ax.plot([0, 1], [0, 1])
ax.set_xlabel("x-axis")
ax.set_ylabel("y-axis")
ax.set_title("Example Plot with mplhep Style")
hep.atlas.label("Preliminary") # Example using a label from mplhep

plt.show()

view raw JSON →