Horizon Chart

Video Streaming Bitrate Horizon

Streaming quality horizon chart showing adaptive bitrate variations with cyan gradient.

Output
Video Streaming Bitrate Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'bands': ['#CFFAFE', '#67E8F9', '#22D3EE', '#06B6D4'],
    'background': '#ffffff',
    'text': '#1f2937',
    'grid': '#e5e7eb',
}

np.random.seed(2929)
seconds = np.arange(0, 600)  # 10-minute video
base = 4000
network_variation = 500 * np.sin(seconds * np.pi / 60)
buffering_events = np.random.choice([0, 1], size=len(seconds), p=[0.98, 0.02])
buffering_drop = np.convolve(buffering_events, np.exp(-np.arange(30)/5), mode='same') * -2000
bitrate = base + network_variation + buffering_drop + np.random.normal(0, 200, len(seconds))
bitrate = np.clip(bitrate, 500, 6000)
bitrate_norm = (bitrate - 500) / 5500

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

band = 0.25

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

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

ax.set_title('Video Streaming Bitrate (Kbps)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Playback Time (minutes)', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Bitrate (Kbps)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 120, 240, 360, 480, 600])
ax.set_xticklabels(['0', '2', '4', '6', '8', '10'])

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