Bubble Chart
Pharma R&D Pipeline Bubble
Drug development by success rate, R&D cost, and duration.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
fig, ax = plt.subplots(figsize=(14, 9), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
areas = ['Oncology', 'Cardiology', 'Neurology', 'Immunology', 'Infectious', 'Rare Disease', 'Diabetes', 'Respiratory']
success = np.array([5, 15, 8, 12, 18, 25, 20, 16])
rd_cost = np.array([4.5, 2.8, 3.5, 3.2, 2.2, 1.8, 2.5, 2.0])
duration = np.array([12, 10, 14, 11, 8, 9, 10, 9])
colors = ['#F5276C', '#C82909', '#4927F5', '#6CF527', '#27D3F5', '#F5B027', '#276CF5', '#27F5B0']
sizes = duration * 60
for glow_mult, glow_alpha in [(2.0, 0.03), (1.6, 0.05), (1.3, 0.08)]:
ax.scatter(success, rd_cost, s=sizes*glow_mult, c='#000000', alpha=glow_alpha, edgecolors='none')
ax.scatter(success, rd_cost, s=sizes, c=colors, alpha=0.85, edgecolors='white', linewidth=2)
ax.scatter(success - np.sqrt(sizes)*0.05, rd_cost + np.sqrt(sizes)*0.012, s=sizes*0.2, c='white', alpha=0.6, edgecolors='none')
for i, area in enumerate(areas):
offset_y = np.sqrt(sizes[i])/2 + 10
ax.annotate(area, (success[i], rd_cost[i]), fontsize=10, color='#1f2937',
ha='center', va='bottom', xytext=(0, offset_y), textcoords='offset points', fontweight='bold')
ax.text(0.0, 1.08, 'Pharma R&D Pipeline', transform=ax.transAxes, fontsize=24, color='#1f2937', fontweight='bold')
ax.text(0.0, 1.02, 'Success Rate vs R&D Cost · Bubble size = Duration', transform=ax.transAxes, fontsize=11, color='#6b7280')
ax.set_xlabel('Clinical Success Rate (%)', fontsize=14, color='#4b5563', fontweight='500', labelpad=15)
ax.set_ylabel('Avg R&D Cost (Billion $)', fontsize=14, color='#4b5563', fontweight='500', labelpad=15)
ax.tick_params(colors='#6b7280', labelsize=11, length=0)
for y in [1, 2, 3, 4, 5]:
ax.axhline(y=y, color='#f3f4f6', linewidth=1, zorder=0)
for spine in ax.spines.values():
spine.set_visible(False)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Pairwise Data
More Bubble Chart examples
☕