Bar Chart
Lollipop Chart Light
Clean lollipop chart with modern light theme
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
categories = ['Category A', 'Category B', 'Category C', 'Category D', 'Category E',
'Category F', 'Category G', 'Category H']
values = np.random.randint(25, 95, len(categories))
sorted_idx = np.argsort(values)
categories = [categories[i] for i in sorted_idx]
values = values[sorted_idx]
fig, ax = plt.subplots(figsize=(10, 7), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
y_pos = np.arange(len(categories))
ax.hlines(y=y_pos, xmin=0, xmax=values, color='#6366f1', alpha=0.7, linewidth=2.5)
ax.scatter(values, y_pos, color='#6366f1', s=140, zorder=3, edgecolor='white', linewidth=2)
for i, v in enumerate(values):
ax.text(v + 2, i, str(v), va='center', color='#1f2937', fontsize=10, fontweight='500')
ax.set_yticks(y_pos)
ax.set_yticklabels(categories, color='#374151', fontsize=10)
ax.set_xlim(0, 110)
ax.set_xlabel('Value', color='#6b7280', fontsize=11)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#e5e7eb')
ax.spines['bottom'].set_color('#e5e7eb')
ax.tick_params(axis='x', colors='#6b7280', labelsize=9)
ax.xaxis.grid(True, color='#f3f4f6', linewidth=1)
ax.set_axisbelow(True)
ax.set_title('Performance Ranking', color='#1f2937', fontsize=14, fontweight='bold', pad=15)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Basic Charts
More Bar Chart examples
☕