Bar Chart

Lollipop Chart

Minimalist horizontal lollipop chart with stems.

Output
Lollipop Chart
Python
import matplotlib.pyplot as plt
import numpy as np

# === STYLE CONFIG ===
COLORS = {
    'primary': '#3B82F6',
    'background': '#FFFFFF',
    'text': '#1E293B',
    'text_muted': '#64748B',
    'grid': '#F1F5F9',
}

# === DATA ===
categories = ['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta']
values = [78, 65, 82, 45, 90, 55]
y = np.arange(len(categories))

# === FIGURE ===
fig, ax = plt.subplots(figsize=(10, 6), dpi=100)
ax.set_facecolor(COLORS['background'])
fig.patch.set_facecolor(COLORS['background'])

# === PLOT ===
# Stems
ax.hlines(y, 0, values, color=COLORS['primary'], linewidth=2, zorder=2)

# Glow circles
ax.scatter(values, y, s=200, c=COLORS['primary'], alpha=0.2, zorder=3)
# Main circles
ax.scatter(values, y, s=100, c=COLORS['primary'], alpha=0.9, 
           edgecolors='white', linewidths=2, zorder=4)

# Value labels - proper offset
for val, yi in zip(values, y):
    ax.text(val + 5, yi, f'{val}', ha='left', va='center', 
            fontsize=10, fontweight='bold', color=COLORS['text'])

# === STYLING ===
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color(COLORS['grid'])
ax.spines['bottom'].set_color(COLORS['grid'])

ax.xaxis.grid(True, color=COLORS['grid'], linewidth=1, zorder=0)
ax.set_axisbelow(True)
ax.tick_params(axis='both', colors=COLORS['text_muted'], labelsize=9, length=0, pad=8)

ax.set_yticks(y)
ax.set_yticklabels(categories)
ax.set_xlim(0, 115)  # Room for labels
ax.set_xlabel('Score', fontsize=10, color=COLORS['text'], labelpad=10)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support