ECDF Plot

Transaction Amount ECDF

Dark theme ECDF showing financial transaction distribution

Output
Transaction Amount 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)
transactions = np.random.lognormal(4.5, 1.5, 800)

ax.ecdf(transactions, color='#10b981', linewidth=2.5)

p25 = np.percentile(transactions, 25)
p75 = np.percentile(transactions, 75)
ax.axvline(x=p25, color='#fbbf24', linestyle='--', linewidth=2, label=f'Q1: ${p25:.0f}')
ax.axvline(x=p75, color='#f472b6', linestyle='--', linewidth=2, label=f'Q3: ${p75:.0f}')

ax.set_xlabel('Transaction Amount ($)', fontsize=12, color='white')
ax.set_ylabel('Cumulative Probability', fontsize=12, color='white')
ax.set_title('Transaction Amount ECDF', fontsize=16, fontweight='bold', color='white', pad=20)
ax.tick_params(colors='white')
ax.set_xlim(0, np.percentile(transactions, 98))
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