Bar Chart

Progress Bars

Task completion progress with clean styling.

Output
Progress Bars
Python
import matplotlib.pyplot as plt
import numpy as np

# === STYLE CONFIG ===
COLORS = {
    'complete': '#10B981',
    'remaining': '#E2E8F0',
    'background': '#FFFFFF',
    'text': '#1E293B',
    'text_muted': '#64748B',
}

# === DATA ===
tasks = ['Project A', 'Project B', 'Project C', 'Project D', 'Project E']
progress = [85, 65, 92, 40, 78]
y = np.arange(len(tasks))

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

# === PLOT ===
# Background bars (100%)
ax.barh(y, [100]*len(tasks), height=0.5, color=COLORS['remaining'], zorder=1)

# Progress bars
bars = ax.barh(y, progress, height=0.5, color=COLORS['complete'], alpha=0.9, zorder=2)

# Percentage labels
for bar, pct in zip(bars, progress):
    ax.text(bar.get_width() + 2, bar.get_y() + bar.get_height()/2, 
            f'{pct}%', 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_visible(False)
ax.spines['bottom'].set_visible(False)

ax.tick_params(axis='both', colors=COLORS['text_muted'], labelsize=10, length=0, pad=8)
ax.tick_params(axis='x', labelbottom=False)

ax.set_yticks(y)
ax.set_yticklabels(tasks)
ax.set_xlim(0, 115)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support