Bubble Chart

Social Media Platforms Bubble

Social platforms compared by users, engagement time, and ad revenue.

Output
Social Media Platforms Bubble
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)

fig, ax = plt.subplots(figsize=(14, 9), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

platforms = ['YouTube', 'Facebook', 'Instagram', 'TikTok', 'X', 'LinkedIn', 'Snapchat', 'Reddit']
dau = np.array([2.5, 2.0, 2.0, 1.5, 0.5, 0.4, 0.4, 0.08])
engagement = np.array([45, 35, 30, 52, 25, 15, 28, 35])
ad_revenue = np.array([30, 85, 50, 18, 4.5, 6, 4.5, 0.8])

colors = ['#F54927', '#276CF5', '#F527B0', '#27D3F5', '#F5B027', '#4927F5', '#F5D327', '#F5276C']
sizes = ad_revenue * 30

for glow_mult, glow_alpha in [(3.5, 0.02), (2.8, 0.04), (2.2, 0.06), (1.7, 0.10), (1.3, 0.15)]:
    ax.scatter(dau, engagement, s=sizes*glow_mult, c=colors, alpha=glow_alpha, edgecolors='none')

ax.scatter(dau, engagement, s=sizes, c=colors, alpha=0.9, edgecolors='none')
ax.scatter(dau, engagement, s=sizes*0.4, c=colors, alpha=0.4, edgecolors='none')
ax.scatter(dau - np.sqrt(sizes)*0.01, engagement + np.sqrt(sizes)*0.06, s=sizes*0.15, c='white', alpha=0.5, edgecolors='none')

for i, platform in enumerate(platforms):
    offset_y = np.sqrt(sizes[i])/2 + 10
    ax.annotate(platform, (dau[i], engagement[i]), fontsize=11, color='white',
                ha='center', va='bottom', xytext=(0, offset_y), textcoords='offset points', fontweight='bold')

ax.text(0.0, 1.08, 'Social Media Platforms', transform=ax.transAxes, fontsize=24, color='white', fontweight='bold')
ax.text(0.0, 1.02, 'Daily Users vs Engagement · Bubble size = Ad Revenue', transform=ax.transAxes, fontsize=11, color='#555555')

ax.set_xlabel('Daily Active Users (Billions)', fontsize=14, color='#888888', fontweight='500', labelpad=15)
ax.set_ylabel('Avg. Engagement (min/day)', fontsize=14, color='#888888', fontweight='500', labelpad=15)
ax.tick_params(colors='#555555', labelsize=11, length=0)

for y in [10, 20, 30, 40, 50, 60]:
    ax.axhline(y=y, color='#1a1a2e', linewidth=0.8, zorder=0)
for spine in ax.spines.values():
    spine.set_visible(False)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Pairwise Data

Did this help you?

Support PyLucid to keep it free & growing

Support