Error Bar Chart
Exercise Recovery Methods
Athletic recovery intervention effectiveness for muscle recovery and soreness.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
interventions = ['Cold\nPlunge', 'Massage', 'Compression', 'Active\nRecovery', 'Sleep', 'Stretching']
muscle_recovery = np.array([35, 28, 22, 18, 42, 15])
soreness_reduction = np.array([42, 38, 25, 20, 35, 28])
muscle_err = np.array([6, 5, 4, 3, 7, 4])
soreness_err = np.array([8, 6, 5, 4, 6, 5])
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
x = np.arange(len(interventions))
width = 0.35
ax.bar(x - width/2, muscle_recovery, width, yerr=muscle_err, label='Muscle Recovery Speed',
color='#F5276C', edgecolor='white', linewidth=1.5, capsize=4,
error_kw={'ecolor': '#374151', 'elinewidth': 2})
ax.bar(x + width/2, soreness_reduction, width, yerr=soreness_err, label='Soreness Reduction',
color='#27D3F5', edgecolor='white', linewidth=1.5, capsize=4,
error_kw={'ecolor': '#374151', 'elinewidth': 2})
ax.set_xlabel('Recovery Method', fontsize=12, color='#374151', fontweight='600')
ax.set_ylabel('Improvement (%)', fontsize=12, color='#374151', fontweight='600')
ax.set_title('Exercise Recovery Methods Effectiveness', fontsize=15,
color='#1f2937', fontweight='bold', pad=20)
ax.set_xticks(x)
ax.set_xticklabels(interventions, fontsize=10)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', fontsize=10)
ax.tick_params(colors='#6b7280', labelsize=10)
ax.set_ylim(0, 58)
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
☕