ECDF Plot
Query Execution Time
Light theme ECDF showing database query performance
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)
query_ms = np.random.lognormal(2.5, 1, 1000)
ax.ecdf(query_ms, color='#0891b2', linewidth=2.5)
slow = 100
very_slow = 1000
ax.axvline(x=slow, color='#f59e0b', linestyle='--', linewidth=2, label=f'Slow (>{slow}ms)')
ax.axvline(x=very_slow, color='#ef4444', linestyle='--', linewidth=2, label=f'Very Slow (>{very_slow}ms)')
ax.set_xlabel('Query Time (ms)', fontsize=12, color='#1f2937')
ax.set_ylabel('Cumulative Probability', fontsize=12, color='#1f2937')
ax.set_title('Database Query Time ECDF', fontsize=16, fontweight='bold', color='#1f2937', pad=20)
ax.set_xlim(0, 2000)
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
☕