3D Scatter

Vaccine Antibody Response by Age

Immunology study showing antibody titer evolution over time by age group.

Output
Vaccine Antibody Response by Age
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(222)

# Antibody response data
n_subjects = 140

day0_titer = np.random.uniform(10, 100, n_subjects)
day28_titer = day0_titer * np.random.uniform(5, 50, n_subjects)
day90_titer = day28_titer * np.random.uniform(0.3, 0.8, n_subjects)

# Age groups affect response
age_group = np.random.choice(['18-35', '36-55', '56+'], n_subjects)
age_colors = {'18-35': '#27D3F5', '36-55': '#6CF527', '56+': '#F5B027'}
colors = [age_colors[a] for a in age_group]

fig = plt.figure(figsize=(10, 8), facecolor='#ffffff')
ax = fig.add_subplot(111, projection='3d', facecolor='#ffffff')

ax.scatter(np.log10(day0_titer), np.log10(day28_titer), np.log10(day90_titer), 
           c=colors, s=50, alpha=0.7, edgecolors='#374151', linewidths=0.3)

ax.set_xlabel('log₁₀(Day 0 Titer)', color='#1f2937', fontsize=10)
ax.set_ylabel('log₁₀(Day 28 Titer)', color='#1f2937', fontsize=10)
ax.set_zlabel('log₁₀(Day 90 Titer)', color='#1f2937', fontsize=10)
ax.set_title('Vaccine Antibody Response by Age', color='#1f2937', fontsize=14, fontweight='bold', pad=20)

ax.tick_params(colors='#6b7280', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#e5e7eb')
ax.yaxis.pane.set_edgecolor('#e5e7eb')
ax.zaxis.pane.set_edgecolor('#e5e7eb')

ax.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support