ECDF Plot
Response Time Analysis
Light theme ECDF for API response time percentiles
Output
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)
response_times = np.random.gamma(2, 50, 1000)
ax.ecdf(response_times, color='#8b5cf6', linewidth=2.5)
p95 = np.percentile(response_times, 95)
p99 = np.percentile(response_times, 99)
ax.axhline(y=0.95, color='#f59e0b', linestyle='--', alpha=0.8)
ax.axhline(y=0.99, color='#ef4444', linestyle='--', alpha=0.8)
ax.axvline(x=p95, color='#f59e0b', linestyle='--', alpha=0.8, label=f'P95: {p95:.0f}ms')
ax.axvline(x=p99, color='#ef4444', linestyle='--', alpha=0.8, label=f'P99: {p99:.0f}ms')
ax.set_xlabel('Response Time (ms)', fontsize=12, color='#1f2937')
ax.set_ylabel('Cumulative Probability', fontsize=12, color='#1f2937')
ax.set_title('API Response Time ECDF', fontsize=16, fontweight='bold', color='#1f2937', pad=20)
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
More ECDF Plot examples
☕