Stackplot

Team Productivity

Weekly output by team member.

Output
Team Productivity
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'members': ['#6366F1', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6'],
    'background': '#FFFFFF',
    'text': '#1E293B',
    'text_muted': '#64748B',
    'grid': '#F1F5F9'
}

weeks = np.arange(1, 13)
alice = [12, 15, 14, 18, 16, 20, 22, 19, 21, 23, 25, 24]
bob = [10, 12, 11, 14, 13, 16, 15, 17, 18, 19, 20, 21]
carol = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
david = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 16]
eve = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]

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

ax.stackplot(weeks, alice, bob, carol, david, eve,
             colors=COLORS['members'], alpha=0.85,
             labels=['Alice', 'Bob', 'Carol', 'David', 'Eve'])

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.yaxis.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_xlim(1, 12)
ax.set_xlabel('Week', fontsize=10, color=COLORS['text'], labelpad=10)
ax.set_ylabel('Tasks Completed', fontsize=10, color=COLORS['text'], labelpad=10)
ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.12), ncol=5, frameon=False, fontsize=9, labelcolor=COLORS['text_muted'])

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support