Raincloud Plot

CPU Benchmark Scores by Processor Generation

Performance benchmarks across chip generations

Output
CPU Benchmark Scores by Processor Generation
Python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import ptitprince as pt

np.random.seed(102)
BG_COLOR = '#0a0a0f'
TEXT_COLOR = 'white'
COLORS = ['#4927F5', '#F5B027', '#27F5B0']

gens = ['Gen 11', 'Gen 12', 'Gen 13']
data = pd.DataFrame({
    'Score': np.concatenate([
        np.random.normal(850, 80, 100),
        np.random.normal(1100, 90, 100),
        np.random.normal(1400, 100, 100)
    ]),
    'Generation': ['Gen 11']*100 + ['Gen 12']*100 + ['Gen 13']*100
})

fig, ax = plt.subplots(figsize=(10, 6), facecolor=BG_COLOR)
ax.set_facecolor(BG_COLOR)

pt.RainCloud(x='Generation', y='Score', data=data, palette=COLORS,
             bw=.2, width_viol=.6, ax=ax, orient='h', alpha=.65,
             dodge=True, pointplot=False, move=.2)

ax.set_xlabel('Benchmark Score', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_ylabel('CPU Generation', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_title('CPU Benchmark by Generation', fontsize=14, color=TEXT_COLOR, fontweight='bold', pad=15)

ax.tick_params(colors='#888', labelsize=10)
for spine in ax.spines.values():
    spine.set_color('#333')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support