Horizon Chart
Application Memory Usage Horizon
System memory consumption horizon chart with deep purple neon gradient showing allocation patterns.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
COLORS = {
'bands': ['#2d1b4e', '#4c2882', '#8B5CF6', '#A78BFA'],
'background': '#0a0a0f',
'text': '#ffffff',
}
np.random.seed(444)
minutes = np.arange(0, 480) # 8 hours
# Memory pattern with gradual increase and GC drops
memory = 2000 + np.cumsum(np.random.uniform(-5, 15, len(minutes)))
# Simulate garbage collection
gc_events = np.random.choice([0, 1], size=len(minutes), p=[0.98, 0.02])
memory = memory - gc_events * np.random.uniform(200, 500, len(minutes))
memory = np.clip(memory, 1500, 4000)
memory_norm = (memory - 1500) / 2500
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(memory_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(minutes, 0, np.clip(memory_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(minutes, 0, np.clip(memory_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(minutes, 0, np.clip(memory_norm - 3*band, 0, band), color=COLORS['bands'][3])
ax.set_xlim(0, 479)
ax.set_ylim(0, 0.3)
ax.set_title('Application Memory Usage (MB)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Time', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Memory (MB)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 120, 240, 360, 480])
ax.set_xticklabels(['09:00', '11:00', '13:00', '15:00', '17: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
☕