Faceted Scatter Plot

CPU Performance by Architecture

Multi-panel benchmark analysis across processor generations

Output
CPU Performance by Architecture
Python
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np

np.random.seed(789)

architectures = ['x86-64', 'ARM64', 'RISC-V', 'Apple M']
data = []
for arch in architectures:
    n = 40
    cores = np.random.uniform(2, 32, n)
    perf_coeffs = {'x86-64': 1.8, 'ARM64': 1.5, 'RISC-V': 1.3, 'Apple M': 2.2}
    performance = perf_coeffs[arch] * np.sqrt(cores) * 1000 + np.random.normal(0, 200, n)
    for c, p in zip(cores, performance):
        data.append({'Core Count': c, 'Benchmark Score': p, 'Architecture': arch})

df = pd.DataFrame(data)

plt.style.use('dark_background')
sns.set_style("darkgrid", {
    'axes.facecolor': '#0a0a0f',
    'figure.facecolor': '#0a0a0f',
    'grid.color': '#333333'
})

palette = ['#F5276C', '#4927F5', '#D3F527', '#27D3F5']

g = sns.lmplot(
    data=df,
    x='Core Count',
    y='Benchmark Score',
    hue='Architecture',
    col='Architecture',
    col_wrap=2,
    height=3.5,
    aspect=1.2,
    palette=palette,
    scatter_kws={'alpha': 0.75, 's': 50, 'edgecolor': 'white', 'linewidths': 0.4},
    line_kws={'linewidth': 2.5},
    ci=95,
    order=1
)

g.fig.set_facecolor('#0a0a0f')
for ax in g.axes.flat:
    ax.set_facecolor('#0a0a0f')
    for spine in ax.spines.values():
        spine.set_color('#333333')

g.fig.suptitle('Multi-Core Scaling Analysis', fontsize=14, fontweight='bold', color='white', y=1.02)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Pairwise Data

Did this help you?

Support PyLucid to keep it free & growing

Support