Skip to content

Commit ef7b546

Browse files
prontclaude
andcommitted
Revert heatmap colormap to YlOrRd, keep zero-cell masking
The green-yellow-red gradient didn't read as well as the original. Keep the masked-zero-cells change so empty months still show plain white instead of a yellow tint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d40d75e commit ef7b546

4 files changed

Lines changed: 3 additions & 6 deletions
168 Bytes
Loading
359 Bytes
Loading
201 Bytes
Loading

scripts/util/plot.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import numpy as np
88
import numpy.ma as ma
99
import pandas as pd
10-
from matplotlib.colors import LinearSegmentedColormap
1110
from matplotlib.patches import FancyBboxPatch
1211
from matplotlib.ticker import MaxNLocator
1312

@@ -615,11 +614,9 @@ def plot_contributor_heatmap(path, table, output_path, top_n=10, window_months=1
615614
pivot = pivot.sort_values(by=[last_month, "_total"], ascending=False).drop(columns="_total")
616615

617616
fig, ax = plt.subplots(figsize=(12, 5))
618-
# Green→yellow→red gradient; zero cells masked so the plain axes
619-
# background shows through instead of the colormap's low end.
620-
cmap = LinearSegmentedColormap.from_list(
621-
"green_red", ["#36B37E", "#F1C232", "#D62728"]
622-
)
617+
# Zero cells masked so the plain axes background shows through
618+
# instead of the colormap's low end tint.
619+
cmap = plt.get_cmap("YlOrRd").copy()
623620
cmap.set_bad(color="white")
624621
masked = ma.masked_where(pivot.values == 0, pivot.values)
625622
im = ax.imshow(masked, aspect="auto", cmap=cmap)

0 commit comments

Comments
 (0)