Error Bar Chart

Meal Kit Delivery Comparison

Meal kit subscription service comparison for variety, quality, and value.

Output
Meal Kit Delivery Comparison
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)

services = ['HelloFresh', 'Blue Apron', 'Home Chef', 'Sunbasket', 'Factor']
recipe_variety = np.array([92, 85, 88, 82, 75])
ingredient_quality = np.array([85, 90, 82, 95, 88])
value = np.array([78, 72, 85, 68, 75])
err = np.array([4, 5, 4, 5, 6])

fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

x = np.arange(len(services))
width = 0.25

ax.bar(x - width, recipe_variety, width, yerr=err, label='Recipe Variety',
       color='#6CF527', edgecolor='white', linewidth=1.5, capsize=4,
       error_kw={'ecolor': '#374151', 'elinewidth': 1.5})
ax.bar(x, ingredient_quality, width, yerr=err, label='Ingredient Quality',
       color='#F5B027', edgecolor='white', linewidth=1.5, capsize=4,
       error_kw={'ecolor': '#374151', 'elinewidth': 1.5})
ax.bar(x + width, value, width, yerr=err, label='Value for Money',
       color='#27D3F5', edgecolor='white', linewidth=1.5, capsize=4,
       error_kw={'ecolor': '#374151', 'elinewidth': 1.5})

ax.set_xlabel('Meal Kit Service', fontsize=12, color='#374151', fontweight='600')
ax.set_ylabel('Score', fontsize=12, color='#374151', fontweight='600')
ax.set_title('Meal Kit Delivery Service Comparison', fontsize=15, 
             color='#1f2937', fontweight='bold', pad=20)

ax.set_xticks(x)
ax.set_xticklabels(services, fontsize=10)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', fontsize=10)
ax.tick_params(colors='#6b7280', labelsize=10)
ax.set_ylim(55, 105)
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

Did this help you?

Support PyLucid to keep it free & growing

Support