Plotting (Python)
The BasePlotting, TH1F, TH2F, and TLine Cython classes
wrap the C++ plotting engine. They use matplotlib under the hood
and support LaTeX labels, stacked histograms, ratio panels, and
KS-test annotations.
Note
BasePlotting cannot be instantiated directly. Use TH1F,
TH2F, or TLine.
BasePlotting — Common Properties
All plotting classes inherit the following properties.
Property |
Type |
Description |
|---|---|---|
|
|
Output file stem (extension added automatically). |
|
|
Directory where the figure is saved. |
|
|
Figure title (rendered as LaTeX if |
|
|
x-axis label. |
|
|
y-axis label. |
|
|
matplotlib style sheet name (e.g. |
|
|
Figure resolution in dots per inch. |
|
|
Global font size. |
|
|
Axis label font size. |
|
|
Legend font size. |
|
|
Title font size. |
|
|
Render all text with LaTeX. |
|
|
Figure width scaling factor. |
|
|
Figure height scaling factor. |
|
|
Automatically scale figure dimensions. |
|
|
matplotlib line style string (e.g. |
|
|
Use log scale on the x-axis. |
|
|
Use log scale on the y-axis. |
|
|
x-axis tick step. |
|
|
y-axis tick step. |
|
|
x-axis range. |
|
|
y-axis range. |
|
|
Accumulate entries beyond |
|
|
Single colour for the current dataset. |
|
|
Colour list when plotting multiple datasets. |
|
|
matplotlib hatch pattern (e.g. |
|
|
Error-bar cap size. |
|
|
Draw error bars on the histogram. |
TH1F — 1D Histogram
Property |
Type |
Description |
|---|---|---|
|
|
Raw data values to histogram. |
|
|
Number of histogram bins. |
|
|
Per-entry weights (same length as |
|
|
Sample cross-section used for normalisation. |
|
|
Luminosity used for cross-section rescaling. |
|
|
Fill histogram area with colour. |
|
|
Stack multiple datasets vertically. |
|
|
Histogram outline width. |
|
|
Fill opacity (0–1). |
|
|
Normalise histogram to unit area. |
|
|
matplotlib marker style. |
|
|
Map of bin-centre value → label string for categorical axes. |
|
|
Annotate each bin with its count. |
TH2F — 2D Histogram
Property |
Type |
Description |
|---|---|---|
|
|
x-axis data values. |
|
|
y-axis data values. |
|
|
Number of x-axis bins. |
|
|
Number of y-axis bins. |
|
|
Categorical labels for x-axis bins. |
|
|
Categorical labels for y-axis bins. |
|
|
Per-entry weights. |
TLine — Line Plot
Property |
Type |
Description |
|---|---|---|
|
|
x-axis values. |
|
|
y-axis values. |
|
|
Upper uncertainty band values. |
|
|
Lower uncertainty band values. |
|
|
matplotlib marker style. |
|
|
Line width. |
|
|
Line opacity. |