Raincloud Plot

Reaction Time in Gaming by Genre

Player response times across game categories

Output
Reaction Time in Gaming by Genre
Python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import ptitprince as pt

np.random.seed(117)
BG_COLOR = '#0a0a0f'
TEXT_COLOR = 'white'
COLORS = ['#F54927', '#4927F5', '#6CF527']

genres = ['FPS', 'MOBA', 'Racing']
data = pd.DataFrame({
    'ReactionTime': np.concatenate([
        np.random.gamma(4, 25, 120),
        np.random.gamma(5, 30, 110),
        np.random.gamma(4.5, 28, 100)
    ]),
    'Genre': ['FPS']*120 + ['MOBA']*110 + ['Racing']*100
})

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

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

ax.set_xlabel('Reaction Time (ms)', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_ylabel('Game Genre', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_title('Gaming Reaction Time by Genre', 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