Error Bar Chart
Storage Performance Comparison
NVMe SSD vs SATA SSD vs HDD performance benchmarks with variability.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
metrics = ['Sequential\nRead', 'Sequential\nWrite', 'Random\nRead', 'Random\nWrite', 'Boot\nTime']
nvme = np.array([7000, 5500, 1000, 900, 8])
sata_ssd = np.array([550, 520, 95, 90, 15])
hdd = np.array([180, 160, 2, 2, 45])
nvme_err = np.array([500, 400, 100, 80, 1])
sata_err = np.array([30, 25, 10, 8, 2])
hdd_err = np.array([20, 15, 0.5, 0.5, 5])
# Normalize to log scale for visibility
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
x = np.arange(len(metrics))
width = 0.25
ax.bar(x - width, nvme, width, yerr=nvme_err, label='NVMe SSD',
color='#5314E6', edgecolor='white', linewidth=1.5, capsize=3,
error_kw={'ecolor': '#374151', 'elinewidth': 1.5})
ax.bar(x, sata_ssd, width, yerr=sata_err, label='SATA SSD',
color='#27D3F5', edgecolor='white', linewidth=1.5, capsize=3,
error_kw={'ecolor': '#374151', 'elinewidth': 1.5})
ax.bar(x + width, hdd, width, yerr=hdd_err, label='HDD',
color='#9ca3af', edgecolor='white', linewidth=1.5, capsize=3,
error_kw={'ecolor': '#374151', 'elinewidth': 1.5})
ax.set_yscale('log')
ax.set_xlabel('Metric', fontsize=12, color='#374151', fontweight='600')
ax.set_ylabel('Speed (MB/s) / Time (s)', fontsize=12, color='#374151', fontweight='600')
ax.set_title('Storage Performance: NVMe vs SATA SSD vs HDD', fontsize=15,
color='#1f2937', fontweight='bold', pad=20)
ax.set_xticks(x)
ax.set_xticklabels(metrics, fontsize=10)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', fontsize=10)
ax.tick_params(colors='#6b7280', labelsize=10)
ax.grid(True, axis='y', alpha=0.4, color='#e5e7eb')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#d1d5db')
ax.spines['bottom'].set_color('#d1d5db')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Statistical
More Error Bar Chart examples
☕