Horizon Chart

Electricity Grid Demand Horizon

Power grid demand visualization using amber/yellow gradient bands showing daily consumption patterns.

Output
Electricity Grid Demand Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'bands': ['#FEF3C7', '#FCD34D', '#F59E0B', '#D97706'],
    'background': '#ffffff',
    'text': '#1f2937',
    'grid': '#e5e7eb',
}

np.random.seed(111)
hours = np.linspace(0, 168, 1008)  # Week in hours (10-min intervals)
# Weekly electricity pattern
base = 60 + 25 * np.sin(hours * np.pi / 12)  # Daily cycle
weekly = 10 * np.sin(hours * np.pi / 84)  # Weekly cycle
demand = base + weekly + np.random.normal(0, 5, len(hours))
demand_norm = demand / 100

fig, ax = plt.subplots(figsize=(14, 3), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])

band = 0.25

ax.fill_between(hours, 0, np.clip(demand_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(hours, 0, np.clip(demand_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(hours, 0, np.clip(demand_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(hours, 0, np.clip(demand_norm - 3*band, 0, band), color=COLORS['bands'][3])

ax.set_xlim(0, 168)
ax.set_ylim(0, 0.3)

ax.set_title('Weekly Electricity Demand (GW)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Day', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Demand (GW)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 24, 48, 72, 96, 120, 144, 168])
ax.set_xticklabels(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', ''])

for spine in ax.spines.values():
    spine.set_color(COLORS['grid'])
ax.tick_params(colors=COLORS['text'], labelsize=9)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Time Series

Did this help you?

Support PyLucid to keep it free & growing

Support