Bar Chart
Grouped Comparison Light
Side-by-side bars with clean light styling
Output
Python
import matplotlib.pyplot as plt
import numpy as np
categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
actual = [72, 85, 78, 92, 88, 95]
target = [80, 80, 80, 85, 85, 90]
x = np.arange(len(categories))
width = 0.35
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
bars1 = ax.bar(x - width/2, actual, width, label='Actual', color='#22c55e', edgecolor='none')
bars2 = ax.bar(x + width/2, target, width, label='Target', color='#e5e7eb', edgecolor='#d1d5db')
for bar in bars1:
height = bar.get_height()
ax.text(bar.get_x() + bar.get_width()/2., height + 1, f'{int(height)}',
ha='center', va='bottom', color='#374151', fontsize=9)
ax.set_xticks(x)
ax.set_xticklabels(categories, color='#374151', fontsize=10)
ax.set_ylabel('Sales (K)', color='#6b7280', fontsize=11)
ax.set_ylim(0, 110)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#e5e7eb')
ax.spines['bottom'].set_color('#e5e7eb')
ax.tick_params(axis='both', colors='#6b7280', labelsize=9)
ax.yaxis.grid(True, color='#f3f4f6', linewidth=1)
ax.set_axisbelow(True)
ax.legend(loc='upper left', frameon=False, labelcolor='#374151', fontsize=9)
ax.set_title('Monthly Sales Performance', color='#1f2937', fontsize=14, fontweight='bold', pad=15)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Basic Charts
More Bar Chart examples
☕