from pyhs3.data import BinnedData
from pyhs3.axes import BinnedAxis

# Create binned data with regular binning
data = BinnedData(
    name="example",
    type="binned",
    contents=[10.0, 20.0, 15.0, 25.0, 18.0],
    axes=[BinnedAxis(name="x", min=0.0, max=5.0, nbins=5)]
)

# Convert to hist and plot
h = data.to_hist()
h.plot(histtype="fill", alpha=0.7, label="Signal")
plt.xlabel("x")
plt.ylabel("Events")
plt.legend()
plt.title("1D Regular Binning")