Error Bar Chart
Social Media App Ratings
App store ratings comparison between iOS and Android for major social media apps.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
apps = ['Instagram', 'TikTok', 'Snapchat', 'Twitter/X', 'Threads']
ios_rating = np.array([4.7, 4.8, 4.5, 4.2, 4.0])
android_rating = np.array([4.5, 4.6, 4.3, 4.0, 3.8])
ios_err = np.array([0.1, 0.08, 0.12, 0.15, 0.18])
android_err = np.array([0.12, 0.1, 0.14, 0.18, 0.22])
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
x = np.arange(len(apps))
width = 0.35
bars1 = ax.bar(x - width/2, ios_rating, width, yerr=ios_err,
label='iOS App Store', color='#276CF5', edgecolor='white',
linewidth=2, capsize=5, error_kw={'ecolor': '#1f2937', 'elinewidth': 1.5})
bars2 = ax.bar(x + width/2, android_rating, width, yerr=android_err,
label='Google Play', color='#6CF527', edgecolor='white',
linewidth=2, capsize=5, error_kw={'ecolor': '#1f2937', 'elinewidth': 1.5})
ax.axhline(y=4.5, color='#F5B027', linestyle='--', linewidth=2,
label='Excellent (4.5+)', alpha=0.8)
ax.set_xlabel('App', fontsize=12, color='#374151', fontweight='600')
ax.set_ylabel('Rating', fontsize=12, color='#374151', fontweight='600')
ax.set_title('Social Media App Ratings Comparison', fontsize=15,
color='#1f2937', fontweight='bold', pad=20)
ax.set_xticks(x)
ax.set_xticklabels(apps, fontsize=11)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', fontsize=10)
ax.tick_params(colors='#6b7280', labelsize=10)
ax.set_ylim(3.2, 5.2)
ax.grid(True, axis='y', alpha=0.4, color='#e5e7eb')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#d1d5db')
ax.spines['bottom'].set_color('#d1d5db')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Statistical
More Error Bar Chart examples
☕