Raincloud Plot
Salary Distribution by Programming Language
Developer compensation across tech stacks
Output
Python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import ptitprince as pt
np.random.seed(118)
BG_COLOR = '#0a0a0f'
TEXT_COLOR = 'white'
COLORS = ['#F5D327', '#27D3F5', '#F5276C', '#6CF527']
langs = ['Python', 'JavaScript', 'Rust', 'Go']
data = pd.DataFrame({
'Salary': np.concatenate([
np.random.normal(145, 35, 100),
np.random.normal(130, 40, 120),
np.random.normal(165, 30, 60),
np.random.normal(155, 32, 70)
]),
'Language': ['Python']*100 + ['JavaScript']*120 + ['Rust']*60 + ['Go']*70
})
fig, ax = plt.subplots(figsize=(10, 6), facecolor=BG_COLOR)
ax.set_facecolor(BG_COLOR)
pt.RainCloud(x='Language', y='Salary', data=data, palette=COLORS,
bw=.2, width_viol=.6, ax=ax, orient='h', alpha=.65,
dodge=True, pointplot=False, move=.2)
ax.set_xlabel('Annual Salary ($K)', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_ylabel('Language', fontsize=12, color=TEXT_COLOR, fontweight='500')
ax.set_title('Developer Salary by Language', 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
☕