Compare before and after with a dumbbell chart

Visualize

Compare before and after with a dumbbell chart

Created: Last updated: Read time: 1 min

A dumbbell chart connects the start and end values with a single line to show the gap visually.

import numpy as np
import matplotlib.pyplot as plt

departments = ["Sales", "Engineering", "Support", "Marketing", "HR"]
before = np.array([68, 72, 65, 70, 60])
after = np.array([78, 80, 72, 74, 68])

fig, ax = plt.subplots(figsize=(6, 4))
ax.hlines(departments, before, after, color="#94a3b8", linewidth=3)
ax.scatter(before, departments, color="#ef4444", s=80, label="Before")
ax.scatter(after, departments, color="#22c55e", s=80, label="After")

ax.set_xlabel("Engagement score")
ax.set_title("Engagement before and after (dumbbell chart)")
ax.legend(loc="lower right")
ax.grid(axis="x", alpha=0.2)

fig.tight_layout()

plt.show()

A dumbbell chart shows the gap between two points clearly.

Reading tips #

  • A line that stretches to the right indicates improvement; to the left indicates decline.
  • Use color and legend to distinguish time points so start and end are obvious.
  • Add labels or annotations if you want to show the numeric gap.