# alaha999/pyhepplotlib architecture

> Architecture diagram of the GitHub repository alaha999/pyhepplotlib, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alaha999/pyhepplotlib
- Repository: https://github.com/alaha999/pyhepplotlib

## Overview

PyHEPPlotLib is a PyROOT plotting library with both a stateful Plotter API and a matplotlib-like pyplot façade. The main workflow configures a figure and style, registers histogram or graph data, draws the plot, and saves it. Plotter also provides 2D histograms, efficiency and limit graphs, pie charts, and summary tables. The graph reflects documented features and sampled imports/calls; unsampled Plotter internals are not expanded into inferred call chains.

Main entry points: [`src/pyplotlib/plotter.py`](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py) (Plotter State), [`src/pyplotlib/pyplot.py`](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/pyplot.py) (pyplot API), [`src/pyplotlib/help.py`](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/help.py) (API Options Help), [`src/pyplotlib/utils.py`](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/utils.py) (Histogram & Graph Helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Public Interfaces"]
  node_pyplot["pyplot API<br/>[pyplot.py]"]
  node_plotter_api["Plotter API<br/>[plotter.py]"]
  node_help["API Options Help<br/>[help.py]"]
end

subgraph group_engine["Plotting Engine"]
  node_plotter["Plotter State<br/>[plotter.py]"]
  node_hist["1D Histograms<br/>[plotter.py]"]
  node_hist2d["2D Histograms<br/>[plotter.py]"]
  node_graphs["Graphs &amp; Efficiency<br/>[plotter.py]"]
  node_pie["Pie Charts<br/>[plotter.py]"]
  node_tables["Summary Tables<br/>[plotter.py]"]
  node_canvas["Canvas &amp; Export<br/>[plotter.py]"]
end

subgraph group_support["Rendering Support"]
  node_styles["Plot Styling<br/>[styles.py]"]
  node_utils["Histogram &amp; Graph Helpers<br/>[utils.py]"]
end

subgraph group_integrations["External Runtime"]
  node_root{{"ROOT / PyROOT"}}
end

node_analyst(("Analyst"))
node_output["Plot File"]

node_analyst -->|"uses"| node_pyplot
node_analyst -->|"uses"| node_plotter_api
node_pyplot -->|"creates and dispatches"| node_plotter
node_pyplot -->|"loads options"| node_help
node_help -->|"discovers API"| node_pyplot
node_help -->|"inspects methods"| node_plotter_api
node_plotter_api -->|"implements plotting"| node_plotter
node_plotter -->|"registers and draws"| node_hist
node_plotter -->|"registers and draws"| node_hist2d
node_plotter -->|"draws graph plots"| node_graphs
node_plotter -->|"draws"| node_pie
node_plotter -->|"prints"| node_tables
node_plotter -->|"draws and saves"| node_canvas
node_canvas -->|"writes plot"| node_output
node_plotter -->|"uses styles"| node_styles
node_plotter -->|"uses helpers"| node_utils
node_plotter -->|"creates ROOT objects"| node_root
node_utils -->|"transforms ROOT data"| node_root

click node_pyplot "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/pyplot.py"
click node_plotter_api "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_plotter "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_hist "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_hist2d "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_graphs "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_pie "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_tables "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_canvas "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py"
click node_styles "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/styles.py"
click node_utils "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/utils.py"
click node_help "https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/help.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pyplot,node_plotter_api,node_help toneBlue
class node_plotter,node_hist,node_hist2d,node_graphs,node_pie,node_tables,node_canvas toneAmber
class node_styles,node_utils toneMint
class node_root toneRose
class node_analyst,node_output toneIndigo
```

## Components

### Public Interfaces

- [pyplot API](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/pyplot.py): `src/pyplotlib/pyplot.py`
- [Plotter API](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [API Options Help](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/help.py): `src/pyplotlib/help.py`

### Plotting Engine

- [Plotter State](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [1D Histograms](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [2D Histograms](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [Graphs & Efficiency](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [Pie Charts](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [Summary Tables](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`
- [Canvas & Export](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/plotter.py): `src/pyplotlib/plotter.py`

### Rendering Support

- [Plot Styling](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/styles.py): `src/pyplotlib/styles.py`
- [Histogram & Graph Helpers](https://github.com/alaha999/pyhepplotlib/blob/main/src/pyplotlib/utils.py): `src/pyplotlib/utils.py`

### External Runtime

- **ROOT / PyROOT**

### Other components

- **Analyst**
- **Plot File**

## Connections

- Analyst → pyplot API: uses (evidence: `README.md`)
- Analyst → Plotter API: uses (evidence: `README.md`)
- pyplot API → Plotter State: creates and dispatches (evidence: `src/pyplotlib/pyplot.py`)
- pyplot API → API Options Help: loads options (evidence: `src/pyplotlib/pyplot.py`)
- API Options Help → pyplot API: discovers API (evidence: `src/pyplotlib/help.py`)
- API Options Help → Plotter API: inspects methods (evidence: `src/pyplotlib/help.py`)
- Plotter API → Plotter State: implements plotting (evidence: `src/pyplotlib/__init__.py`)
- Plotter State → 1D Histograms: registers and draws (evidence: `README.md`)
- Plotter State → 2D Histograms: registers and draws (evidence: `src/pyplotlib/plotter.py`)
- Plotter State → Graphs & Efficiency: draws graph plots (evidence: `src/pyplotlib/plotter.py`)
- Plotter State → Pie Charts: draws (evidence: `src/pyplotlib/plotter.py`)
- Plotter State → Summary Tables: prints (evidence: `src/pyplotlib/pyplot.py`)
- Plotter State → Canvas & Export: draws and saves (evidence: `README.md`)
- Canvas & Export → Plot File: writes plot (evidence: `README.md`)
- Plotter State → Plot Styling: uses styles (evidence: `src/pyplotlib/plotter.py`)
- Plotter State → Histogram & Graph Helpers: uses helpers (evidence: `src/pyplotlib/plotter.py`)
- Plotter State → ROOT / PyROOT: creates ROOT objects (evidence: `src/pyplotlib/plotter.py`)
- Histogram & Graph Helpers → ROOT / PyROOT: transforms ROOT data (evidence: `src/pyplotlib/utils.py`)
