Skip to main content
Data Visualization
CHAPTER 25 Beginner

Common Visualization Mistakes

Updated: May 18, 2026
5 min read

# CHAPTER 25

Common Visualization Mistakes

1. Chapter Introduction

Misleading visualizations are widespread — in news media, marketing materials, and business reports. This chapter identifies the 10 most common visualization mistakes with real Python examples showing the wrong and correct approach.

2. Mistake 1: Truncated Y-Axis

python
123456789101112131415161718192021222324
import matplotlib.pyplot as plt
import numpy as np

months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
sales  = [98500, 99200, 98800, 99500, 99700, 100200]

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))

# WRONG: Truncated Y-axis makes tiny difference look huge
ax1.bar(months, sales, color='#F44336')
ax1.set_ylim(98000, 100500)  # 2.2% range looks like 200% growth!
ax1.set_title('❌ Truncated Y-Axis\n(2.2% difference looks massive)', color='red')

# RIGHT: Full Y-axis shows true magnitude
ax2.bar(months, sales, color='#4CAF50')
ax2.set_ylim(0, 120000)
ax2.set_title('✅ Full Y-Axis\n(True magnitude preserved)', color='green')
ax2.text(0.5, 0.95, 'Actual growth: +1.7%', transform=ax2.transAxes,
          ha='center', fontsize=11, color='green', fontweight='bold')

plt.suptitle('Mistake: Truncated Y-Axis', fontsize=13, fontweight='bold')
plt.tight_layout()
plt.savefig('truncated_axis.png', dpi=150)
plt.show()

3. Mistake 2: Wrong Chart Type

python
12345678910111213141516171819202122
# Using a line chart for unrelated categories (not time series)
categories = ['Marketing', 'Engineering', 'Sales', 'HR', 'Finance']
headcount  = [25, 48, 32, 12, 18]

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))

# WRONG: Line chart implies continuous change between categories
ax1.plot(categories, headcount, 'o-', color='red', linewidth=2, markersize=8)
ax1.set_title('❌ Wrong: Line Chart for Categorical Data\n(Line implies connection between depts)', color='red')

# RIGHT: Bar chart for categorical comparison
ax2.bar(categories, headcount, color=['#1565C0' if h == max(headcount) else '#90CAF9' for h in headcount])
for i, val in enumerate(headcount):
    ax2.text(i, val + 0.3, str(val), ha='center', fontweight='bold')
ax2.set_title('✅ Correct: Bar Chart for Categories', color='green')
ax2.spines['top'].set_visible(False)
ax2.spines['right'].set_visible(False)

plt.suptitle('Mistake: Wrong Chart Type', fontsize=13, fontweight='bold')
plt.tight_layout()
plt.savefig('wrong_chart_type.png', dpi=150)
plt.show()

4. Mistake 3: Misleading Pie Charts

python
123456789101112131415161718192021222324
# Too many slices / no sorting
labels = [f'Cat {i}' for i in range(1, 13)]  # 12 categories!
sizes  = np.random.dirichlet(np.ones(12)) * 100

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))

# WRONG: 12-slice pie
ax1.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=90)
ax1.set_title('❌ Wrong: 12-Slice Pie\n(Impossible to compare)', color='red')

# RIGHT: Sorted bar chart
sorted_pairs = sorted(zip(sizes, labels), reverse=True)
s_sorted, l_sorted = zip(*sorted_pairs)
ax2.barh(l_sorted[::-1], list(s_sorted)[::-1],
          color=['#1565C0' if s == max(s_sorted) else '#90CAF9' for s in reversed(list(s_sorted))])
ax2.set_xlabel('Share (%)')
ax2.set_title('✅ Better: Sorted Horizontal Bar', color='green')
ax2.spines['top'].set_visible(False)
ax2.spines['right'].set_visible(False)

plt.suptitle('Mistake: Too Many Pie Slices', fontsize=13, fontweight='bold')
plt.tight_layout()
plt.savefig('pie_mistake.png', dpi=150)
plt.show()

5. Top 10 Visualization Mistakes Summary

text
123456789101112
MISTAKE                       FIX
──────────────────────────────────────────────────────────────────
1. Truncated Y-axis           → Start at 0 for bar charts
2. Wrong chart type           → Use chart selection decision tree
3. Too many pie slices (>5)   → Use sorted bar chart or treemap
4. 3D charts                  → Never use 3D for 2D data
5. Rainbow (jet) colormap     → Use viridis or perceptually uniform
6. Too many colors            → Max 7 categories; grey for context
7. Missing labels/units       → Always label axes with units
8. Dual Y-axes                → Use separate charts instead
9. Unsorted bars              → Sort by value (except time data)
10. Overplotting              → Use alpha, hexbin, or sampling

6. MCQs

Question 1

Truncated Y-axis on bar charts is problematic because?

Question 2

Line chart should NOT be used for?

Question 3

Pie chart maximum recommended slices?

Question 4

3D bar charts distort because?

Question 5

Overplotting in scatter plots is fixed with?

Question 6

Dual Y-axis charts are problematic because?

Question 7

Rainbow (jet) colormap issue?

Question 8

Missing axis units (e.g., no '$' or '%') causes?

Question 9

Unsorted bar charts make it?

Question 10

"Chart junk" removal improves?

7. Interview Questions

  • Q: What is the most common misleading technique in data visualization?
  • Q: How do you fix overplotting in a scatter plot with 100,000 points?

8. Summary

Top 10 mistakes: truncated axes, wrong chart types, pie chart overuse, 3D charts, rainbow colormap, too many colors, missing labels, dual Y-axes, unsorted bars, overplotting. Each mistake has a clear fix. Building awareness of these errors separates professional visualizations from misleading ones.

9. Next Chapter Recommendation

In Chapter 26: Data Visualization with Pandas, we use Pandas' built-in .plot() API for rapid EDA visualization directly from DataFrames.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·