ANOVA Boxplot

Video Streaming Quality ANOVA

Comparing video quality metrics across streaming platforms.

Output
Video Streaming Quality ANOVA
Python
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats

np.random.seed(888)

# VMAF score (0-100)
netflix = np.random.normal(92, 4, 100)
youtube = np.random.normal(85, 6, 100)
prime = np.random.normal(88, 5, 100)
disney = np.random.normal(90, 4.5, 100)

netflix = np.clip(netflix, 70, 100)
youtube = np.clip(youtube, 60, 98)
prime = np.clip(prime, 65, 99)
disney = np.clip(disney, 72, 100)

F_stat, p_value = stats.f_oneway(netflix, youtube, prime, disney)

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

colors = ['#C82909', '#F5276C', '#27D3F5', '#276CF5']
data = [netflix, youtube, prime, disney]

bp = ax.boxplot(data, positions=[1, 2, 3, 4], widths=0.6, patch_artist=True,
                medianprops={'color': 'white', 'linewidth': 2},
                whiskerprops={'color': '#555555', 'linewidth': 1.5},
                capprops={'color': '#555555', 'linewidth': 1.5},
                flierprops={'marker': 'o', 'markerfacecolor': '#444444', 'markersize': 4})

for patch, color in zip(bp['boxes'], colors):
    patch.set_facecolor(color)
    patch.set_alpha(0.7)
    patch.set_edgecolor('white')
    patch.set_linewidth(1.5)

labels = ['Netflix', 'YouTube', 'Prime Video', 'Disney+']

# Quality zones
ax.axhspan(90, 100, alpha=0.1, color='#22c55e')
ax.axhline(y=90, color='#22c55e', linestyle='--', alpha=0.5, linewidth=1)
ax.text(4.45, 90, 'Excellent', fontsize=7, color='#22c55e', va='center')

# Bitrate info
bitrates = ['15 Mbps', '12 Mbps', '10 Mbps', '14 Mbps']
for i, (d, br, color) in enumerate(zip(data, bitrates, colors)):
    ax.text(i+1, 58, f'μ={d.mean():.1f} | {br}', ha='center', fontsize=8, color=color)

# Stats header
stats_text = f"ANOVA: F={F_stat:.2f}, p={p_value:.4f} | Best Quality: Netflix (VMAF={netflix.mean():.1f})"
bbox = dict(boxstyle="round,pad=0.3", facecolor='#0d1117', edgecolor='#C82909', lw=2)
ax.text(0.5, 1.02, stats_text, transform=ax.transAxes, fontsize=9, color='white',
        ha='center', va='bottom', fontfamily='monospace', bbox=bbox)

ax.set_xticks([1, 2, 3, 4])
ax.set_xticklabels(labels, fontsize=11, color='white')
ax.set_ylabel('VMAF Score', fontsize=12, color='white', fontweight='500')
ax.set_title('Streaming Platform Video Quality\n4K HDR Content Comparison', 
             fontsize=14, color='white', fontweight='bold', pad=25)

ax.tick_params(colors='#888888')
for spine in ax.spines.values():
    spine.set_color('#333333')
ax.yaxis.grid(True, color='#1a1a2e', linewidth=0.5)
ax.set_axisbelow(True)
ax.set_ylim(55, 102)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support