ANOVA Violin Plot
GPU Gaming Performance ANOVA
Comparing frame rate distributions across graphics card tiers.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
np.random.seed(999)
# FPS at 1440p Ultra settings
rtx_4060 = np.random.normal(72, 12, 80)
rtx_4070 = np.random.normal(98, 15, 80)
rtx_4080 = np.random.normal(135, 18, 80)
rtx_4090 = np.random.normal(175, 22, 80)
F_stat, p_value = stats.f_oneway(rtx_4060, rtx_4070, rtx_4080, rtx_4090)
fig, ax = plt.subplots(figsize=(12, 7), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
# Gaming neon colors
colors = ['#6CF527', '#27D3F5', '#F527B0', '#F5D327']
parts = ax.violinplot([rtx_4060, rtx_4070, rtx_4080, rtx_4090],
positions=[1, 2, 3, 4], showmeans=True, showmedians=True, widths=0.75)
for i, pc in enumerate(parts['bodies']):
pc.set_facecolor(colors[i])
pc.set_alpha(0.7)
pc.set_edgecolor(colors[i])
pc.set_linewidth(2)
parts['cmeans'].set_color('white')
parts['cmeans'].set_linewidth(2.5)
parts['cmedians'].set_color('#F5276C')
for partname in ['cbars', 'cmins', 'cmaxes']:
parts[partname].set_color('#444444')
# Frame rate thresholds - labels on right
ax.axhline(y=60, color='#fbbf24', linestyle='--', alpha=0.6, linewidth=1.5)
ax.axhline(y=144, color='#22c55e', linestyle='--', alpha=0.6, linewidth=1.5)
ax.text(4.45, 60, '60Hz', fontsize=8, color='#fbbf24', va='center')
ax.text(4.45, 144, '144Hz', fontsize=8, color='#22c55e', va='center')
# 1% Low and Price annotations at bottom
labels = ['RTX 4060', 'RTX 4070', 'RTX 4080', 'RTX 4090']
prices = ['$299', '$599', '$1199', '$1599']
for i, (data, color, price) in enumerate(zip([rtx_4060, rtx_4070, rtx_4080, rtx_4090], colors, prices)):
low_1 = np.percentile(data, 1)
ax.text(i+1, 20, f'1%Low:{low_1:.0f} | {price}', ha='center', fontsize=8, color=color)
# Stats text
stats_text = f"ANOVA: F={F_stat:.1f}, p<0.001 | Cyberpunk 2077 @ 1440p Ultra+RT"
bbox = dict(boxstyle="round,pad=0.3", facecolor='#020B14', edgecolor='#F527B0', 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('Frames Per Second (FPS)', fontsize=12, color='white', fontweight='500')
ax.set_title('NVIDIA RTX 40 Series Gaming Performance\n1440p Ultra Settings Benchmark',
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(10, 230)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Statistical
More ANOVA Violin Plot examples
☕