Horizon Chart

Music Streaming Activity Horizon

Entertainment analytics horizon chart showing music streaming patterns with purple gradient.

Output
Music Streaming Activity Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'bands': ['#F3E8FF', '#D8B4FE', '#A855F7', '#9333EA'],
    'background': '#ffffff',
    'text': '#1f2937',
    'grid': '#e5e7eb',
}

np.random.seed(2121)
hours = np.arange(0, 168)  # Week
# Streaming: commute peaks, evening relaxation
commute_am = 30 * np.exp(-((hours % 24 - 8)**2) / 3)
commute_pm = 35 * np.exp(-((hours % 24 - 18)**2) / 4)
evening = 25 * np.exp(-((hours % 24 - 21)**2) / 5)
streaming = commute_am + commute_pm + evening + np.random.exponential(5, len(hours))
streaming = np.clip(streaming, 0, 80)
streaming_norm = streaming / 80

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(streaming_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(hours, 0, np.clip(streaming_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(hours, 0, np.clip(streaming_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(hours, 0, np.clip(streaming_norm - 3*band, 0, band), color=COLORS['bands'][3])

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

ax.set_title('Music Streaming Activity (streams/min)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Day', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Streams/min', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 24, 48, 72, 96, 120, 144])
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