Line & Scatter
Neon Glow Line
Line chart with neon glow effect using layered transparency.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# === STYLE CONFIG ===
COLORS = {
'glow': '#06B6D4', # Cyan
'background': '#0F172A', # Dark slate
'text': '#E2E8F0',
'grid': '#334155',
}
# === DATA ===
x = np.linspace(0, 10, 200)
y = 4 + 2 * np.sin(x) + 0.5 * np.sin(3 * x)
# === FIGURE ===
fig, ax = plt.subplots(figsize=(10, 6), dpi=100)
ax.set_facecolor(COLORS['background'])
fig.patch.set_facecolor(COLORS['background'])
# === GLOW EFFECT - Multiple layers with decreasing alpha ===
glow_layers = [
(15, 0.02),
(12, 0.03),
(9, 0.05),
(6, 0.08),
(4, 0.15),
(2.5, 1.0),
]
for linewidth, alpha in glow_layers:
ax.plot(x, y, color=COLORS['glow'], linewidth=linewidth,
alpha=alpha, solid_capstyle='round')
# === AXES ===
ax.set_xlim(0, 10)
ax.set_ylim(0, 8)
ax.set_xlabel('Time', fontsize=10, color=COLORS['text'], labelpad=10)
ax.set_ylabel('Signal', 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.5)
ax.xaxis.grid(False)
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
☕