ECDF Plot

Network Latency ECDF

Light theme ECDF for network latency analysis

Output
Network Latency ECDF
Python
import matplotlib.pyplot as plt
import numpy as np

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

np.random.seed(42)
latency = np.random.lognormal(3, 0.8, 1000)

ax.ecdf(latency, color='#6366f1', linewidth=2.5)

p50 = np.percentile(latency, 50)
p95 = np.percentile(latency, 95)
p99 = np.percentile(latency, 99)
ax.axvline(x=p50, color='#22c55e', linestyle='--', linewidth=2, label=f'P50: {p50:.0f}ms')
ax.axvline(x=p95, color='#f59e0b', linestyle='--', linewidth=2, label=f'P95: {p95:.0f}ms')
ax.axvline(x=p99, color='#ef4444', linestyle='--', linewidth=2, label=f'P99: {p99:.0f}ms')

ax.set_xlabel('Latency (ms)', fontsize=12, color='#1f2937')
ax.set_ylabel('Cumulative Probability', fontsize=12, color='#1f2937')
ax.set_title('Network Latency ECDF', fontsize=16, fontweight='bold', color='#1f2937', pad=20)
ax.set_xlim(0, np.percentile(latency, 99.5))
ax.legend(loc='lower right')
ax.grid(True, alpha=0.3)

for spine in ['top', 'right']:
    ax.spines[spine].set_visible(False)

plt.tight_layout()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support