Horizon Chart

Heart Rate Variability Horizon

Medical horizon chart showing heart rate variability with coral pink neon bands on dark background.

Output
Heart Rate Variability Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'high': ['#4d1a30', '#8a3050', '#F5276C'],
    'low': ['#1a3d4d', '#2d6070', '#27F5B0'],
    'background': '#0a0a0f',
    'text': '#ffffff',
}

np.random.seed(789)
seconds = np.arange(0, 300)  # 5 minutes
hrv = 50 + 20 * np.sin(seconds * 0.05) + np.random.normal(0, 10, len(seconds))
hrv_centered = hrv - 50

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

band = 15

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

ax.fill_between(seconds, 0, np.clip(hrv_centered, -band, 0), color=COLORS['high'][0])
ax.fill_between(seconds, 0, np.clip(hrv_centered + band, -band, 0), color=COLORS['high'][1])
ax.fill_between(seconds, 0, np.clip(hrv_centered + 2*band, -band, 0), color=COLORS['high'][2])

ax.axhline(0, color='#555555', linewidth=0.5)
ax.set_xlim(0, 299)
ax.set_ylim(-20, 20)

ax.set_title('Heart Rate Variability (RMSSD)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Time (seconds)', color=COLORS['text'], fontsize=10)
ax.set_ylabel('HRV (ms)', color='white', fontsize=10)

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

Did this help you?

Support PyLucid to keep it free & growing

Support