Mirror Chart

Senior vs Junior Developer Productivity

Mirror density comparing daily commits with experience-based analysis

Output
Senior vs Junior Developer Productivity
Python
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde

np.random.seed(222)
BG_COLOR = '#0d1117'

# Daily commits
senior = np.clip(np.random.poisson(9, 600) + np.random.normal(0, 1.5, 600), 1, 25)
junior = np.clip(np.random.poisson(5, 600) + np.random.normal(0, 2, 600), 0, 18)

fig, ax = plt.subplots(figsize=(12, 7), facecolor=BG_COLOR)
ax.set_facecolor(BG_COLOR)

x = np.linspace(0, 25, 500)

# Senior (top) - purple
kde_s = gaussian_kde(senior)
y_s = kde_s(x)
ax.fill_between(x, y_s, alpha=0.2, color='#4927F5')
ax.plot(x, y_s, color='#4927F5', linewidth=5, alpha=0.3)
ax.plot(x, y_s, color='#4927F5', linewidth=2.5, label=f'Senior (μ={np.mean(senior):.1f} commits)')

# Junior (bottom) - mint
kde_j = gaussian_kde(junior)
y_j = kde_j(x) * -1
ax.fill_between(x, y_j, alpha=0.2, color='#27F5B0')
ax.plot(x, y_j, color='#27F5B0', linewidth=5, alpha=0.3)
ax.plot(x, y_j, color='#27F5B0', linewidth=2.5, label=f'Junior (μ={np.mean(junior):.1f} commits)')

ax.axhline(0, color='#444444', linewidth=1.5)

# Productivity ratio
ratio = np.mean(senior) / np.mean(junior)

# Big ratio annotation
ax.text(20, max(y_s)*0.6, f'{ratio:.1f}x', fontsize=36, color='#4927F5',
        fontweight='bold', ha='center', alpha=0.9)

# Code review consideration
ax.text(20, max(y_s)*0.3, 'More commits ≠ Better code', fontsize=10, 
        color='#888888', ha='center', style='italic')

# Percentile comparison
s_p75 = np.percentile(senior, 75)
j_p75 = np.percentile(junior, 75)
ax.scatter([s_p75], [kde_s(s_p75)], color='#4927F5', s=100, zorder=5, edgecolors='white', linewidths=2)
ax.scatter([j_p75], [-kde_j(j_p75)], color='#27F5B0', s=100, zorder=5, edgecolors='white', linewidths=2)

# Stats
stats = f"P75: Senior={s_p75:.0f} | Junior={j_p75:.0f} | Consistency: Senior σ={np.std(senior):.1f}, Junior σ={np.std(junior):.1f}"
ax.text(0.5, 0.98, stats, transform=ax.transAxes, ha='center', va='top',
        fontsize=10, color='#888888', fontfamily='monospace',
        bbox=dict(boxstyle='round,pad=0.4', facecolor=BG_COLOR, edgecolor='#333333'))

ax.set_xlabel('Daily Commits', fontsize=12, color='white', fontweight='500')
ax.set_title('Developer Productivity by Experience', fontsize=16, color='white', fontweight='bold', pad=25)

ax.tick_params(colors='#888888', labelsize=10)
ax.set_yticks([])
for spine in ['top', 'right']:
    ax.spines[spine].set_visible(False)
for spine in ['bottom', 'left']:
    ax.spines[spine].set_color('#333333')
ax.legend(loc='upper right', facecolor=BG_COLOR, edgecolor='#333333', labelcolor='white', fontsize=10)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support