Claude-skill-registry hist
Use when working with the scikit-hep hist library in Python to create, fill, slice, and plot histograms (1D/2D/multi-axis), including UHI indexing, categorical axes, and mplhep plotting conventions.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/hist" ~/.claude/skills/majiayu000-claude-skill-registry-hist && rm -rf "$T"
manifest:
skills/data/hist/SKILL.mdsource content
Hist
Overview
Use this skill to build and manipulate hist.Hist objects, choose axis/storage types, fill with data and weights, and produce publication-style plots with mplhep styles, all based on matplotlib.
Quick start
- Create histograms with
plus axis builders (Hist.new
,Reg
,Var
) and finish with exactly one storage (StrCat
orInt64
).Weight - Make sure axis labels contain a short variable name and units. Histogram titles should contains a slightly longer concise description of what data went into the plot.
- Fill with
using axis names; note that.fill(...)
returns.fill
.None - Slice or project with UHI indexing (e.g.,
orh.project("x")
).h[{"x": 5j}] - Plot with
orhist.plot(...)
; usemplhep.hist2dplot(...)
for HEP-style plots.plt.style.use(hep.style.ATLAS)
Core tasks
Create axes and storage
- Use
for uniform bins andReg
for variable-width bins.Var - Use
for categorical axes; setStrCat
for auto-added categories.growth=True - Choose storage:
for unweighted counts,Int64
for weighted fills.Weight
Fill and access contents
- Fill with named axes (e.g.,
).h.fill(x=..., y=..., weight=...) - Read counts with
and errors fromh.view()
.np.sqrt(h.variances())
Slice, rebin, and project
- Use UHI slicing (complex numbers for bin selection,
for rebinning).::2j - Project with
for 1D plots.h.project("axis_name")
Plot and save
- Use
for 1D; usehist.plot(histtype="fill")
for 2D.mplhep.hist2dplot - Use
without customplt.subplots()
unless explicitly requested.figsize - Save with
and close withfig.savefig("name.png")
.plt.close(fig)
References
- Use
for concrete code snippets and common patterns.references/hist-hints.md - Use
for UHI indexing, plotting gotchas, and label/LaTeX guidance.references/hist-advanced.md - Use
for starting suggestions on histogram axis ranges and binning.references/lhc-hist-ranges.md