A Simple histogram drawing example.
import mplhep as hep
import numpy as np
import ROOT
from ROOT import TFile, gROOT
File = "py-hsimple.root"
ROOT.Info(
"hist015_TH1_read_and_draw.py", File +
" does not exist")
info_text = f"Entries = {entries}\nMean = {mean:.5f}\nStd Dev = {std_dev:.3f}"
hep.histplot(hpx, ax=ax1, histtype=
"fill", color=
"#EEAC91", alpha=0.5, edgecolor=
"blue", linewidth=1.5)
0.65,
0.95,
info_text,
verticalalignment="top",
fontsize=10,
bbox=dict(boxstyle="round,pad=0.3", facecolor="white", alpha=0.7),
)
ax2.bar3d(x, y, z, dx, dy, dz, color=
"#EEAC91", edgecolor=
"darkblue", alpha=0.85)
0.55,
0.85,
info_text,
fontsize=10,
bbox=dict(boxstyle="round,pad=0.3", facecolor="white", alpha=0.7),
)
hep.histplot(hpx, ax=ax3, histtype=
"errorbar", color=
"darkblue")
0.90,
0.95,
info_text,
verticalalignment="top",
fontsize=10,
bbox=dict(boxstyle="round,pad=0.3", facecolor="white", alpha=0.7),
)
mpl_fig.suptitle(
"Drawing options for one dimensional histograms", fontsize=14, fontweight=
"bold")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
- Date
- July 2025
- Author
- Wim Lavrijsen, Nursena Bitirgen
Definition in file hist015_TH1_read_and_draw_uhi.py.