Error Bar Chart

CPU Benchmark Performance

Processor benchmark comparison showing single-core and multi-core scores with measurement variability.

Output
CPU Benchmark Performance
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)

# CPU benchmark data
processors = ['Intel i9\n14900K', 'AMD Ryzen\n9 7950X', 'Apple\nM3 Max', 'Intel i7\n14700K', 'AMD Ryzen\n7 7800X']
single_core = np.array([2350, 2180, 2150, 2100, 1950])
multi_core = np.array([24500, 23800, 21500, 18500, 15200])
single_err = np.array([50, 45, 40, 55, 35])
multi_err = np.array([800, 750, 650, 600, 450])

fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

x = np.arange(len(processors))
width = 0.35

bars1 = ax.bar(x - width/2, single_core, width, yerr=single_err, 
               label='Single-Core', color='#4927F5', edgecolor='white',
               capsize=4, error_kw={'ecolor': '#a78bfa', 'elinewidth': 1.5})

# Secondary axis for multi-core
ax2 = ax.twinx()
bars2 = ax2.bar(x + width/2, multi_core, width, yerr=multi_err,
                label='Multi-Core', color='#27F5B0', edgecolor='white',
                capsize=4, error_kw={'ecolor': '#86efac', 'elinewidth': 1.5})

ax.set_xlabel('Processor', fontsize=11, color='white', fontweight='500')
ax.set_ylabel('Single-Core Score', fontsize=11, color='#a78bfa', fontweight='500')
ax2.set_ylabel('Multi-Core Score', fontsize=11, color='#86efac', fontweight='500')
ax.set_title('CPU Benchmark Performance Comparison', fontsize=14, 
             color='white', fontweight='bold', pad=15)

ax.set_xticks(x)
ax.set_xticklabels(processors)
ax.tick_params(colors='#94a3b8', labelsize=9)
ax2.tick_params(colors='#94a3b8', labelsize=9)

lines1, labels1 = ax.get_legend_handles_labels()
lines2, labels2 = ax2.get_legend_handles_labels()
ax.legend(lines1 + lines2, labels1 + labels2, loc='upper right',
          facecolor='#1a1a2e', edgecolor='#333', labelcolor='white')

ax.grid(True, alpha=0.2, color='#4a4a6a')
for spine in ax.spines.values():
    spine.set_color('#333333')
for spine in ax2.spines.values():
    spine.set_color('#333333')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support