Horizon Chart
IoT Sensor Readings Horizon
Smart home sensor horizon chart with cyan neon bands showing environmental readings.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
COLORS = {
'bands': ['#0d4d4d', '#1a8080', '#22D3EE', '#67E8F9'],
'background': '#0a0a0f',
'text': '#ffffff',
}
np.random.seed(2222)
minutes = np.arange(0, 1440) # 24 hours
# Sensor: temperature with HVAC cycling
base_temp = 21 + 2 * np.sin(minutes * 2 * np.pi / 1440) # Daily variation
hvac_cycle = 0.5 * np.sin(minutes * 2 * np.pi / 30) # 30-min HVAC cycle
temp = base_temp + hvac_cycle + np.random.normal(0, 0.2, len(minutes))
temp_norm = (temp - 18) / 8
fig, ax = plt.subplots(figsize=(14, 3), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])
band = 0.25
ax.fill_between(minutes, 0, np.clip(temp_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(minutes, 0, np.clip(temp_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(minutes, 0, np.clip(temp_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(minutes, 0, np.clip(temp_norm - 3*band, 0, band), color=COLORS['bands'][3])
ax.set_xlim(0, 1439)
ax.set_ylim(0, 0.3)
ax.set_title('Smart Home Temperature Sensor (°C)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Time', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Temperature (°C)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 360, 720, 1080, 1440])
ax.set_xticklabels(['00:00', '06:00', '12:00', '18:00', '24:00'])
for spine in ax.spines.values():
spine.set_visible(False)
ax.tick_params(colors=COLORS['text'], labelsize=9)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Time Series
More Horizon Chart examples
☕