Hexbin Plot
Startup Unit Economics
Monthly recurring revenue vs customer acquisition cost efficiency.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
np.random.seed(42)
n_startups = 6000
mrr = np.random.lognormal(3, 1.2, n_startups)
mrr = np.clip(mrr, 1, 500)
cac_payback = np.random.lognormal(2, 0.8, n_startups)
cac_payback = np.clip(cac_payback, 1, 36)
fig, ax = plt.subplots(figsize=(10, 8), facecolor='#ffffff')
ax.set_facecolor('#f0fdfa')
colors = ['#f0fdfa', '#ccfbf1', '#99f6e4', '#5eead4', '#2dd4bf',
'#14b8a6', '#0d9488', '#0f766e', '#115e59', '#134e4a']
cmap = LinearSegmentedColormap.from_list('teal', colors, N=256)
hb = ax.hexbin(mrr, cac_payback, gridsize=35, cmap=cmap, mincnt=1,
edgecolors='white', linewidths=0.3)
from matplotlib.patches import Rectangle
healthy = Rectangle((50, 1), 450, 11, fill=False, edgecolor='#0d9488',
linewidth=2.5, linestyle='-', alpha=0.8, label='Healthy Zone')
ax.add_patch(healthy)
ax.axhline(y=18, color='#f59e0b', linestyle='--', alpha=0.8, linewidth=2, label='Warning (18mo)')
ax.axhline(y=24, color='#ef4444', linestyle=':', alpha=0.8, linewidth=2, label='Critical (24mo)')
cbar = plt.colorbar(hb, ax=ax, pad=0.02, shrink=0.85)
cbar.set_label('Startup Count', fontsize=11, color='#134e4a', labelpad=10)
cbar.ax.yaxis.set_tick_params(color='#0f766e')
cbar.outline.set_edgecolor('#99f6e4')
plt.setp(plt.getp(cbar.ax.axes, 'yticklabels'), color='#0f766e', fontsize=9)
ax.set_xlabel('MRR ($K)', fontsize=12, color='#134e4a', fontweight='600', labelpad=12)
ax.set_ylabel('CAC Payback (months)', fontsize=12, color='#134e4a', fontweight='600', labelpad=12)
ax.set_title('Startup Unit Economics', fontsize=16, color='#042f2e', fontweight='700', pad=20)
ax.tick_params(colors='#0f766e', labelsize=10, length=0)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#99f6e4')
ax.spines['bottom'].set_color('#99f6e4')
ax.legend(loc='upper right', fontsize=9, frameon=True, facecolor='white',
edgecolor='#99f6e4', labelcolor='#134e4a')
ax.grid(True, alpha=0.3, color='#99f6e4', linestyle='-', linewidth=0.5)
ax.set_axisbelow(True)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Pairwise Data
More Hexbin Plot examples
☕