Line & Scatter
Neon Error Bars
Dark mode error bars with glowing neon effect.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# === STYLE CONFIG ===
COLORS = {
'points': '#22D3EE',
'glow': '#22D3EE',
'background': '#0F172A',
'text': '#E2E8F0',
'grid': '#334155',
}
# === DATA ===
x = np.array([1, 2, 3, 4, 5, 6])
y = np.array([2.5, 4.2, 3.8, 5.5, 5.0, 6.2])
yerr = np.array([0.5, 0.7, 0.4, 0.8, 0.6, 0.5])
# === FIGURE ===
fig, ax = plt.subplots(figsize=(10, 6), dpi=100)
ax.set_facecolor(COLORS['background'])
fig.patch.set_facecolor(COLORS['background'])
# === PLOT ===
# Glow effect on error bars
for lw, alpha in [(12, 0.05), (8, 0.08), (5, 0.12)]:
ax.errorbar(x, y, yerr=yerr, fmt='none', ecolor=COLORS['glow'],
elinewidth=lw, capsize=0, alpha=alpha)
# Main error bars
ax.errorbar(x, y, yerr=yerr, fmt='o', color=COLORS['points'],
ecolor=COLORS['points'], elinewidth=2, capsize=6, capthick=2,
markersize=10, markeredgecolor=COLORS['background'],
markeredgewidth=2, zorder=5)
# Point glow
for xi, yi in zip(x, y):
for s, alpha in [(300, 0.05), (150, 0.1), (80, 0.2)]:
ax.scatter([xi], [yi], s=s, color=COLORS['glow'], alpha=alpha, zorder=4)
# === AXES ===
ax.set_xlim(0, 7)
ax.set_ylim(0, 8)
ax.set_xlabel('Sample', 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.5)
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
☕