Line & Scatter
Stacked Glow Areas
Stacked area chart with glowing edges.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# === STYLE CONFIG ===
COLORS = {
'area1': '#06B6D4',
'area2': '#8B5CF6',
'area3': '#F43F5E',
'background': '#0F172A',
'text': '#E2E8F0',
'grid': '#334155',
}
# === DATA ===
x = np.linspace(0, 10, 100)
y1 = 1.5 + 0.5 * np.sin(x)
y2 = y1 + 1.2 + 0.4 * np.sin(x + 1)
y3 = y2 + 1.0 + 0.3 * np.sin(x + 2)
# === FIGURE ===
fig, ax = plt.subplots(figsize=(10, 6), dpi=100)
ax.set_facecolor(COLORS['background'])
fig.patch.set_facecolor(COLORS['background'])
# === PLOT ===
# Areas with transparency
ax.fill_between(x, 0, y1, color=COLORS['area1'], alpha=0.4)
ax.fill_between(x, y1, y2, color=COLORS['area2'], alpha=0.4)
ax.fill_between(x, y2, y3, color=COLORS['area3'], alpha=0.4)
# Glowing edges
for y, color in [(y1, COLORS['area1']), (y2, COLORS['area2']), (y3, COLORS['area3'])]:
for lw, alpha in [(6, 0.15), (3, 0.3), (1.5, 1.0)]:
ax.plot(x, y, color=color, linewidth=lw, alpha=alpha)
# === AXES ===
ax.set_xlim(0, 10)
ax.set_ylim(0, 6)
ax.set_xlabel('Time', fontsize=10, color=COLORS['text'], labelpad=10)
ax.set_ylabel('Value', fontsize=10, color=COLORS['text'], labelpad=10)
# === STYLING ===
for spine in ax.spines.values():
spine.set_visible(False)
ax.yaxis.grid(True, color=COLORS['grid'], linewidth=0.5, alpha=0.3)
ax.set_axisbelow(True)
ax.tick_params(axis='both', colors=COLORS['text'], labelsize=9, length=0, pad=8)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Pairwise Data
More Line & Scatter examples
☕