ECDF Plot

Salary Distribution ECDF

Dark theme ECDF comparing salary by experience level

Output
Salary Distribution ECDF
Python
import matplotlib.pyplot as plt
import numpy as np

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

np.random.seed(42)
junior = np.random.normal(55000, 8000, 300)
mid = np.random.normal(85000, 12000, 300)
senior = np.random.normal(130000, 20000, 300)

ax.ecdf(junior, color='#34d399', linewidth=2.5, label='Junior')
ax.ecdf(mid, color='#fbbf24', linewidth=2.5, label='Mid-Level')
ax.ecdf(senior, color='#f472b6', linewidth=2.5, label='Senior')

ax.set_xlabel('Annual Salary ($)', fontsize=12, color='white')
ax.set_ylabel('Cumulative Probability', fontsize=12, color='white')
ax.set_title('Salary by Experience Level', fontsize=16, fontweight='bold', color='white', pad=20)
ax.tick_params(colors='white')
ax.legend(facecolor='#1a1a2f', edgecolor='#333', labelcolor='white')
ax.grid(True, alpha=0.2, color='white')

for spine in ax.spines.values():
    spine.set_color('#333')

plt.tight_layout()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support