hist

Build, fill, slice, and plot histograms with hist.Hist and UHI indexing.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/gordonwatts/skill-test --skill hist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hist
Source: https://github.com/gordonwatts/skill-test/tree/main/.codex/skills/hist
Command: npx skills add https://github.com/gordonwatts/skill-test --skill hist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building, filling, slicing, and plotting histograms for Python-based high-energy physics analysis with correct axis configuration and storage choices can be verbose and error-prone.

Core Features & Use Cases

  • Create histograms using Hist.new with axis builders Reg, Var, and StrCat, and finish with a single storage (Int64 or Weight) to manage counts or weights.
  • Fill histograms with named axes, read counts with view, slice and project with UHI indexing, and produce publication-ready plots using mplhep styling.
  • Save figures to files for reporting and collaboration, following standard matplotlib conventions.

Quick Start

Create a histogram with Hist.new, define axes with Reg/Var/StrCat, finish with a single Int64 or Weight storage, then fill using h.fill and plot with hist.plot or mplhep plotting helpers.

Frequently Asked Questions about hist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and fill histograms in Python for high-energy physics analysis?

Create histograms in Python using Hist.new with axis builders like Reg, Var, or StrCat, then finish with Int64 or Weight storage. Fill the histogram using h.fill with named axes to manage counts or weights for high-energy physics analysis.

How do I configure regular, variable, and categorical axes for histogram binning?

Configure histogram binning by using Reg for regular fixed-width bins, Var for variable-width bins, and StrCat for string categorical axes. These axis builders are chained via Hist.new to define the histogram dimensions before selecting a storage type.

Can I slice and project multi-dimensional histograms using UHI indexing in Python?

Yes, you can slice and project multi-dimensional histograms using UHI indexing in Python. The Hist library supports 1D, 2D, and multi-axis histograms, allowing you to read counts with view and extract specific regions or projections for detailed analysis.

What is the best way to generate publication-ready histogram plots with mplhep styling?

Generate publication-ready histogram plots by applying mplhep styling to your filled histograms. Use hist.plot or mplhep plotting helpers to render visuals, then save figures to files for reporting and collaboration following standard matplotlib conventions.

When should I use Int64 versus Weight storage for histogram filling?

Use Int64 storage for simple integer counts and Weight storage when handling weighted events during histogram filling. Both storage types are supported when finalizing the histogram creation with Hist.new, ensuring correct data representation for analysis.