namruto77's picture
Upload VeriRender benchmark dataset
d323f57 verified
Raw
History Blame Contribute Delete
1.34 kB
import numpy as np
import matplotlib.pyplot as plt
# ── Parameters ─────────────────────────────────────────────────────────────
seed = 4904
color = "mediumseagreen"
# ── Data ────────────────────────────────────────────────────────────────────
labels = ['A', 'B', 'C', 'D', 'E']
heights = [1.31, 3.65, 0.96, -1.43, 0.04]
# ── Plot ────────────────────────────────────────────────────────────────────
fig, ax = plt.subplots(figsize=(7, 4))
bars = ax.bar(labels, heights, color=color, edgecolor='white', linewidth=0.5)
ax.axhline(0, color='black', linewidth=0.8)
for bar, h in zip(bars, heights):
va = 'bottom' if h >= 0 else 'top'
offset = 0.05 if h >= 0 else -0.05
ax.text(bar.get_x() + bar.get_width()/2, h + offset,
f'{h:.2f}', ha='center', va=va, fontsize=8, fontweight='bold')
ax.set_title("Bar Chart (5 categories)")
ax.set_xlabel("Category")
ax.set_ylabel("Value")
fig.tight_layout()
plt.show()