Raincloud Plot

Internet Speed by ISP

Download speeds across providers

Output
Internet Speed by ISP
Python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import ptitprince as pt

np.random.seed(213)
BG_COLOR = '#ffffff'
TEXT_COLOR = '#1f2937'
COLORS = ['#F5276C', '#27D3F5', '#6CF527']

isps = ['Fiber', 'Cable', 'DSL']
data = pd.DataFrame({
    'Speed': np.concatenate([
        np.random.normal(800, 150, 80),
        np.random.normal(350, 100, 100),
        np.random.normal(80, 30, 70)
    ]),
    'ISP': ['Fiber']*80 + ['Cable']*100 + ['DSL']*70
})

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

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

ax.set_xlabel('Download Speed (Mbps)', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_ylabel('Connection Type', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_title('Internet Speed by Provider Type', fontsize=14, color=TEXT_COLOR, fontweight='bold', pad=15)

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

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support