Calendar Heatmap

Deep Work Minutes Calendar

Daily deep work sessions tracked in neon purple gradient for productivity.

Output
Deep Work Minutes Calendar
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.patches as mpatches

np.random.seed(132)

days = 365
deep_work = np.random.exponential(90, days)
deep_work = np.clip(deep_work, 0, 240)
for i in range(days):
    if i % 7 >= 5:
        deep_work[i] = deep_work[i] * 0.3

weeks = 53
data = np.zeros((7, weeks))
for i, val in enumerate(deep_work):
    week = i // 7
    day = i % 7
    if week < weeks:
        data[day, week] = val

# CLAUDE.md Neon Purple palette
colors_neon = ['#ffffff', '#e5e0fc', '#9a78f9', '#4927F5']
cmap = LinearSegmentedColormap.from_list('neon_purple', colors_neon, N=256)

fig, ax = plt.subplots(figsize=(16, 4), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

im = ax.imshow(data, cmap=cmap, aspect='auto', vmin=0, vmax=240)

ax.set_yticks(range(7))
ax.set_yticklabels(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], fontsize=9, color='#374151')
ax.set_xticks(range(0, 52, 4))
ax.set_xticklabels(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ''], 
                   fontsize=9, color='#374151')

ax.set_title('Deep Work - Focused Minutes Per Day', fontsize=16, color='#1f2937', fontweight='bold', pad=15)

for i in range(8):
    ax.axhline(y=i-0.5, color='#e5e7eb', linewidth=0.5)
for i in range(weeks+1):
    ax.axvline(x=i-0.5, color='#e5e7eb', linewidth=0.5)

ax.tick_params(colors='#374151', length=0)
for spine in ax.spines.values():
    spine.set_visible(False)

legend_elements = [mpatches.Patch(facecolor=c, label=l, edgecolor='#d1d5db') 
                   for c, l in zip(colors_neon, ['0', '1-75', '76-160', '161+'])]
ax.legend(handles=legend_elements, loc='upper left', bbox_to_anchor=(0, -0.15), ncol=4, 
          fontsize=8, facecolor='#f9fafb', edgecolor='#d1d5db', labelcolor='#374151', title='Minutes',
          title_fontsize=9)

total = np.sum(deep_work) / 60
ax.annotate(f'{total:.0f} hours of deep work', xy=(0.98, 1.1), xycoords='axes fraction',
            fontsize=11, color='#4927F5', ha='right', fontweight='bold')

plt.tight_layout()
plt.subplots_adjust(bottom=0.25)
plt.show()
Library

Matplotlib

Category

Time Series

Did this help you?

Support PyLucid to keep it free & growing

Support