Event Plot
Developer Commit Patterns
Git commit timing analysis by team member
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Simulate git commit events
np.random.seed(42)
developers = ['Alice', 'Bob', 'Carol', 'David', 'Eve']
# Work hours simulation (more commits during work hours)
commits = []
for _ in developers:
work_commits = np.random.normal(12, 2, np.random.randint(20, 40))
night_commits = np.random.uniform(0, 24, np.random.randint(0, 5))
all_commits = np.clip(np.concatenate([work_commits, night_commits]), 0, 24)
commits.append(np.sort(all_commits))
# Developer colors
colors = ['#10B981', '#3B82F6', '#F59E0B', '#EF4444', '#8B5CF6']
# Create figure
fig, ax = plt.subplots(figsize=(12, 6), facecolor='#0D1117')
ax.set_facecolor('#0D1117')
for i, (c, color) in enumerate(zip(commits, colors)):
# Commit markers
ax.eventplot(c, lineoffsets=i, linelengths=0.5, linewidths=2,
colors=color, alpha=0.8)
# Commit count
ax.text(24.5, i, f'{len(c)}', fontsize=11, va='center',
color=color, fontweight='bold')
# Work hours highlight
ax.axvspan(9, 17, color='#238636', alpha=0.1, zorder=0)
ax.text(13, 4.7, 'Core Hours', ha='center', fontsize=10,
color='#238636', fontweight='500')
# Time grid
for h in range(0, 25, 6):
ax.axvline(h, color='#30363D', linewidth=1)
# Styling
ax.set_yticks(range(len(developers)))
ax.set_yticklabels(developers, fontsize=11, fontweight='500', color='#C9D1D9')
ax.set_xlabel('Hour of Day', fontsize=12, fontweight='500', color='#8B949E')
ax.set_xticks(range(0, 25, 3))
ax.set_xticklabels([f'{h:02d}:00' for h in range(0, 25, 3)], fontsize=9, color='#8B949E')
ax.set_xlim(0, 26)
ax.set_ylim(-0.5, len(developers) - 0.5)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#30363D')
ax.spines['bottom'].set_color('#30363D')
ax.tick_params(colors='#8B949E', labelsize=10)
# GitHub-style contribution label
ax.text(25.5, 4.5, 'commits', fontsize=8, color='#8B949E', rotation=90, va='top')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Statistical
More Event Plot examples
☕