Raincloud Plot
Website Load Time by Hosting Provider
Page speed distribution across cloud providers
Output
Python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import ptitprince as pt
np.random.seed(113)
BG_COLOR = '#0a0a0f'
TEXT_COLOR = 'white'
COLORS = ['#F54927', '#27F5B0', '#276CF5']
providers = ['AWS', 'Azure', 'GCP']
data = pd.DataFrame({
'LoadTime': np.concatenate([
np.random.gamma(2, 0.4, 120),
np.random.gamma(2.2, 0.45, 115),
np.random.gamma(1.9, 0.38, 125)
]),
'Provider': ['AWS']*120 + ['Azure']*115 + ['GCP']*125
})
fig, ax = plt.subplots(figsize=(10, 6), facecolor=BG_COLOR)
ax.set_facecolor(BG_COLOR)
pt.RainCloud(x='Provider', y='LoadTime', data=data, palette=COLORS,
bw=.2, width_viol=.6, ax=ax, orient='h', alpha=.65,
dodge=True, pointplot=False, move=.2)
ax.axvline(2.5, color='#22c55e', linestyle='--', alpha=0.6, linewidth=1.5)
ax.text(2.6, 2.5, 'Good', color='#22c55e', fontsize=9)
ax.set_xlabel('Load Time (seconds)', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_ylabel('Provider', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_title('Website Performance by Provider', 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
More Raincloud Plot examples
☕