Bar Chart

Modern Vertical Bar

Clean vertical bar chart with glow effect and value labels.

Output
Modern Vertical Bar
Python
import matplotlib.pyplot as plt
import numpy as np

# === STYLE CONFIG ===
COLORS = {
    'bar': '#6366F1',
    'background': '#FFFFFF',
    'text': '#1E293B',
    'text_muted': '#64748B',
    'grid': '#F1F5F9',
}

# === DATA ===
categories = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
values = [4.8, 5.5, 3.5, 4.6, 6.5, 6.6, 2.6]
x = np.arange(len(categories))

# === FIGURE ===
fig, ax = plt.subplots(figsize=(10, 6), dpi=100)
ax.set_facecolor(COLORS['background'])
fig.patch.set_facecolor(COLORS['background'])

# === PLOT ===
bars = ax.bar(x, values, width=0.6, color=COLORS['bar'], alpha=0.85,
              edgecolor='white', linewidth=2, zorder=3)

# Glow effect behind bars
for bar in bars:
    ax.bar(bar.get_x() + bar.get_width()/2, bar.get_height(), 
           width=bar.get_width()*1.1, color=COLORS['bar'], alpha=0.15, zorder=1)

# Value labels on top - with proper spacing
for bar, val in zip(bars, values):
    ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + 0.3, 
            f'{val}', ha='center', va='bottom', fontsize=10, 
            fontweight='bold', color=COLORS['text'])

# === STYLING ===
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color(COLORS['grid'])
ax.spines['bottom'].set_color(COLORS['grid'])

ax.yaxis.grid(True, color=COLORS['grid'], linewidth=1, zorder=0)
ax.set_axisbelow(True)
ax.tick_params(axis='both', colors=COLORS['text_muted'], labelsize=9, length=0, pad=8)

ax.set_xticks(x)
ax.set_xticklabels(categories)
ax.set_ylim(0, 9)  # Extra headroom for labels
ax.set_ylabel('Value', fontsize=10, color=COLORS['text'], labelpad=10)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support