A lollipop chart displays categorical data with thin lines (stems) extending from a baseline to circular markers (dots) at each data point. It presents the same information as a bar chart but with a cleaner, more minimalist aesthetic that reduces visual clutter while maintaining clear value comparisons.

""" anyplot.ai
lollipop-basic: Basic Lollipop Chart
Library: seaborn 0.13.2 | Python 3.13.14
Quality: 90/100 | Updated: 2026-07-01
"""
import os
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
# Theme tokens
THEME = os.getenv("ANYPLOT_THEME", "light")
PAGE_BG = "#FAF8F1" if THEME == "light" else "#1A1A17"
ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420"
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
BRAND = "#009E73" # Imprint palette position 1
sns.set_theme(
style="ticks",
rc={
"figure.facecolor": PAGE_BG,
"axes.facecolor": PAGE_BG,
"axes.edgecolor": INK_SOFT,
"axes.labelcolor": INK,
"text.color": INK,
"xtick.color": INK_SOFT,
"ytick.color": INK_SOFT,
"grid.color": INK,
"grid.alpha": 0.15,
"legend.facecolor": ELEVATED_BG,
"legend.edgecolor": INK_SOFT,
},
)
# Data - Product sales by category
categories = [
"Electronics",
"Clothing",
"Home & Garden",
"Sports",
"Books",
"Toys",
"Beauty",
"Automotive",
"Food & Grocery",
"Health",
]
values = [85000, 72000, 58000, 45000, 42000, 38000, 35000, 28000, 25000, 18000]
df = pd.DataFrame({"category": categories, "value": values}).sort_values("value", ascending=True)
# Plot
fig, ax = plt.subplots(figsize=(8, 4.5), dpi=400, facecolor=PAGE_BG)
ax.set_facecolor(PAGE_BG)
# Stems: thin lines from baseline to marker
ax.hlines(y=df["category"], xmin=0, xmax=df["value"], color=BRAND, linewidth=2.0, alpha=0.8, zorder=2)
# Markers: size mapped to value via seaborn size aesthetic — larger dots for higher sales
sns.scatterplot(
data=df,
x="value",
y="category",
size="value",
sizes=(60, 200),
color=BRAND,
edgecolor=PAGE_BG,
linewidth=1.5,
ax=ax,
zorder=3,
legend=False,
)
# Style
title = "lollipop-basic · python · seaborn · anyplot.ai"
ax.set_xlabel("Sales ($)", fontsize=10, color=INK)
ax.set_ylabel("Product Category", fontsize=10, color=INK)
ax.set_title(title, fontsize=12, fontweight="medium", color=INK, pad=12)
ax.tick_params(axis="both", labelsize=8, colors=INK_SOFT)
ax.set_xlim(0, max(values) * 1.08)
ax.xaxis.grid(True, alpha=0.15, linewidth=0.8, color=INK)
ax.yaxis.grid(False)
ax.set_axisbelow(True)
sns.despine(ax=ax)
ax.spines["left"].set_color(INK_SOFT)
ax.spines["bottom"].set_color(INK_SOFT)
plt.tight_layout()
plt.savefig(f"plot-{THEME}.png", dpi=400, facecolor=PAGE_BG)
Runnable source as JSON, for any HTTP client: https://api.anyplot.ai/specs/lollipop-basic/seaborn/code. Any spec id and library id listed in llms-full.txt fit the same URL shape; every URL below is complete and callable.
{
"spec_id": "lollipop-basic",
"language": "python",
"library": "seaborn",
"page": "https://anyplot.ai/lollipop-basic/python/seaborn",
"hub": "https://anyplot.ai/lollipop-basic",
"code_json": "https://api.anyplot.ai/specs/lollipop-basic/seaborn/code",
"spec_json": "https://api.anyplot.ai/specs/lollipop-basic",
"render_light_png": "https://storage.googleapis.com/anyplot-images/plots/lollipop-basic/python/seaborn/plot-light.png",
"render_dark_png": "https://storage.googleapis.com/anyplot-images/plots/lollipop-basic/python/seaborn/plot-dark.png",
"quality_score": 90.0,
"license": "MIT",
"guide": "https://anyplot.ai/llms.txt"
}Part of Basic Lollipop Chart on anyplot.ai.