Horizon Chart

Server CPU Usage Horizon

Multi-layer horizon chart displaying server CPU usage patterns with purple gradient bands.

Output
Server CPU Usage Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'bands': ['#EDE9FE', '#C4B5FD', '#8B5CF6', '#6D28D9'],
    'background': '#ffffff',
    'text': '#1f2937',
    'grid': '#e5e7eb',
}

np.random.seed(123)
hours = np.linspace(0, 24, 288)  # 5-min intervals
# CPU pattern: low at night, high during work hours
base = 30 + 40 * np.exp(-((hours - 14)**2) / 20)
cpu = base + np.random.normal(0, 8, len(hours))
cpu = np.clip(cpu, 0, 100)

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

# Normalize to bands
cpu_norm = cpu / 100
band = 0.25

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

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

ax.set_title('Server CPU Usage (24 Hours)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Hour of Day', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Usage (%)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 6, 12, 18, 24])
ax.set_xticklabels(['00:00', '06:00', '12:00', '18:00', '24:00'])

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