Heatmap

Customer Journey Touchpoints

Seamless heatmap showing customer interaction intensity across touchpoints

Output
Customer Journey Touchpoints
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

fig, ax = plt.subplots(figsize=(12, 8), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

np.random.seed(42)
segments = ['New Users', 'Returning', 'Premium', 'Enterprise', 'Trial']
touchpoints = ['Website', 'Mobile App', 'Email', 'Social', 'Support', 'Webinar', 'Docs']
data = np.random.randint(10, 100, (len(segments), len(touchpoints)))

# Modern gradient: Rose to Fuchsia
colors = ['#fdf2f8', '#fbcfe8', '#f472b6', '#db2777', '#831843']
cmap = LinearSegmentedColormap.from_list('modern', colors, N=256)

im = ax.imshow(data, cmap=cmap, aspect='auto')

ax.set_xticks(range(len(touchpoints)))
ax.set_yticks(range(len(segments)))
ax.set_xticklabels(touchpoints, rotation=45, ha='right', color='#374151', fontsize=10)
ax.set_yticklabels(segments, color='#1f2937', fontsize=10, fontweight='500')

for i in range(len(segments)):
    for j in range(len(touchpoints)):
        val = data[i, j]
        color = '#ffffff' if val > 60 else '#1f2937'
        ax.text(j, i, f'{val}%', ha='center', va='center', color=color, fontsize=10, fontweight='bold')

cbar = plt.colorbar(im, ax=ax, shrink=0.8, pad=0.02)
cbar.set_label('Engagement (%)', color='#1f2937', fontsize=11)
cbar.outline.set_edgecolor('#e5e7eb')
plt.setp(plt.getp(cbar.ax.axes, 'yticklabels'), color='#6b7280')

for spine in ax.spines.values():
    spine.set_color('#e5e7eb')
ax.set_title('Customer Journey Touchpoint Analysis', fontsize=16, color='#111827', fontweight='bold', pad=15)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Heatmaps & Density

Did this help you?

Support PyLucid to keep it free & growing

Support