Error Bar Chart
Smart Home Uptime Reliability
Smart home device uptime reliability metrics comparison.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
devices = ['Speaker', 'Thermostat', 'Lock', 'Lights', 'Camera']
uptime = np.array([99.2, 98.8, 97.5, 99.5, 98.2])
response = np.array([0.8, 2.5, 1.2, 0.5, 1.8])
uptime_err = np.array([0.3, 0.5, 1.0, 0.2, 0.6])
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
x = np.arange(len(devices))
colors = ['#5314E6', '#27D3F5', '#F5B027', '#6CF527', '#F5276C']
bars = ax.bar(x, uptime, yerr=uptime_err, capsize=5, color=colors,
edgecolor='white', linewidth=1.5,
error_kw={'ecolor': '#374151', 'elinewidth': 2})
ax.axhline(y=99, color='#6CF527', linestyle='--', linewidth=2, label='99% Target', alpha=0.7)
ax.set_xlabel('Smart Device', fontsize=12, color='#374151', fontweight='600')
ax.set_ylabel('Uptime (%)', fontsize=12, color='#374151', fontweight='600')
ax.set_title('Smart Home Device Uptime Reliability', fontsize=15,
color='#1f2937', fontweight='bold', pad=20)
ax.set_xticks(x)
ax.set_xticklabels(devices, fontsize=11)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', fontsize=10)
ax.tick_params(colors='#6b7280', labelsize=10)
ax.set_ylim(95, 100.5)
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
☕