ANOVA Violin Plot

CPU Benchmark Performance ANOVA

Statistical comparison of multi-core benchmark scores across processor generations.

Output
CPU Benchmark Performance ANOVA
Python
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats

np.random.seed(123)

# CPU benchmark scores by generation
gen_10 = np.random.normal(8500, 800, 100)
gen_11 = np.random.normal(10200, 750, 100)
gen_12 = np.random.normal(12800, 900, 100)
gen_13 = np.random.normal(15500, 1100, 100)

# ANOVA test
F_stat, p_value = stats.f_oneway(gen_10, gen_11, gen_12, gen_13)

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

colors = ['#4927F5', '#27D3F5', '#6CF527', '#F5B027']

parts = ax.violinplot([gen_10, gen_11, gen_12, gen_13], positions=[1, 2, 3, 4],
                       showmeans=True, showextrema=True, showmedians=True)

for i, pc in enumerate(parts['bodies']):
    pc.set_facecolor(colors[i])
    pc.set_alpha(0.75)
    pc.set_edgecolor('white')
    pc.set_linewidth(1)

parts['cmeans'].set_color('#F5276C')
parts['cmeans'].set_linewidth(2.5)
parts['cmedians'].set_color('white')
for partname in ['cbars', 'cmins', 'cmaxes']:
    parts[partname].set_color('#555555')

# Stats box
stats_text = f"ANOVA Analysis\nF = {F_stat:.1f}\np < 0.001"
bbox = dict(boxstyle="round,pad=0.4", facecolor='#0d1117', edgecolor='#F5276C', lw=2)
ax.text(0.98, 0.98, stats_text, transform=ax.transAxes, fontsize=11, color='white',
        ha='right', va='top', fontfamily='monospace', bbox=bbox)

# Add scatter points for individual data
for i, (data, color) in enumerate(zip([gen_10, gen_11, gen_12, gen_13], colors)):
    x = np.random.normal(i+1, 0.08, len(data))
    ax.scatter(x, data, c=color, alpha=0.3, s=8, zorder=1)

labels = ['10th Gen', '11th Gen', '12th Gen', '13th Gen']
ax.set_xticks([1, 2, 3, 4])
ax.set_xticklabels(labels, fontsize=11, color='white')
ax.set_ylabel('Cinebench R23 Score', fontsize=12, color='white', fontweight='500')
ax.set_xlabel('Intel Core Processor Generation', fontsize=12, color='white', fontweight='500')
ax.set_title('Multi-Core CPU Performance Evolution\nBenchmark Comparison Across Generations', 
             fontsize=14, color='white', fontweight='bold', pad=15)

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)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support