Horizon Chart
Fitness Activity Calories Horizon
Wearable fitness horizon chart showing calorie burn throughout the day with coral pink neon gradient.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
COLORS = {
'bands': ['#4d1a30', '#802050', '#F43F5E', '#FDA4AF'],
'background': '#0a0a0f',
'text': '#ffffff',
}
np.random.seed(3434)
minutes = np.arange(0, 1440) # 24 hours
# Calories: BMR base + activity spikes
bmr_rate = 1.2 # cal/min base
morning_workout = 8 * np.exp(-((minutes - 420)**2) / 1000) # 7am workout
lunch_walk = 3 * np.exp(-((minutes - 780)**2) / 500) # 1pm walk
evening_activity = 5 * np.exp(-((minutes - 1140)**2) / 800) # 7pm activity
calories = bmr_rate + morning_workout + lunch_walk + evening_activity + np.random.exponential(0.5, len(minutes))
calories = np.clip(calories, 0.8, 12)
calories_norm = (calories - 0.8) / 11.2
fig, ax = plt.subplots(figsize=(14, 3), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])
band = 0.25
ax.fill_between(minutes, 0, np.clip(calories_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(minutes, 0, np.clip(calories_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(minutes, 0, np.clip(calories_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(minutes, 0, np.clip(calories_norm - 3*band, 0, band), color=COLORS['bands'][3])
ax.set_xlim(0, 1439)
ax.set_ylim(0, 0.3)
ax.set_title('Calorie Burn Rate (cal/min)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Time', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Cal/min', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 360, 720, 1080, 1440])
ax.set_xticklabels(['00:00', '06:00', '12:00', '18:00', '24:00'])
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
More Horizon Chart examples
☕