Choosing the Right Chart
Match your data question to the right chart type — and avoid the most common visualization mistakes.
A manager asks: 'Show me the sales trend.' You put the data in a pie chart. The meeting goes awkward.
Pie charts show parts of a whole — they're useless for showing how something changes over time. Using the wrong chart doesn't just look bad: it forces the audience to do mental work you should have done for them. Chart selection is the first decision in every visualization.
| Chart | Use when... |
|-------|------------|
| Line | Change over time (trend) |
| Bar | Comparing values across categories |
| Scatter | Relationship between two numeric variables |
| Histogram | Distribution of one numeric variable |
import matplotlib.pyplot as plt
# Line chart — monthly revenue trend
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May']
revenue = [120, 135, 128, 150, 162]
plt.plot(months, revenue, marker='o')
plt.title('Monthly Revenue')
plt.ylabel('Revenue ($K)')
plt.show()You want to show how weekly active users changed over the past year (52 data points). Which chart is most appropriate?
- APie chart — shows user proportions week by week
- BLine chart — shows the trend over time
- CHistogram — shows the distribution of weekly users
- DScatter plot — shows relationship between weeks and users
1. Pie with many slices — impossible to compare angles beyond 4–5 slices. Use a bar chart.
2. 3D charts — adds no information, distorts proportions. Never use 3D.
3. Y-axis not starting at zero (on bar charts) — a bar that goes from 95 to 101 visually looks like it doubled. Always start bar chart y-axis at 0.
4. Too many colors — use 2–3 colors max, with consistent meaning.
Exception: line charts can have a non-zero y-axis when you're showing variation in a tight range — as long as it's clearly labeled.
A bar chart's y-axis starts at 95. Revenue in Jan is 100, Feb is 101. Visually, February's bar looks 6× taller than January's. What's wrong?
- ANothing — both values are accurately labeled
- BStarting the y-axis at 95 instead of 0 makes a 1% difference look enormous, misleading the viewer
- CThe bars should be horizontal to fix this
- DA line chart should be used instead
import pandas as pd
df = pd.read_csv('customers.csv')
# Does spending correlate with account age?
plt.scatter(df['months_active'], df['total_spend'], alpha=0.4, s=20)
plt.xlabel('Months Active')
plt.ylabel('Total Spend ($)')
plt.title('Account Age vs Total Spend')
plt.show()A scatter plot instantly shows if there's a linear relationship, clusters, or outliers. An average grouped by 'months_active bucket' would hide most of this structure.
Create a bar chart:
plt.___(['Electronics', 'Clothing', 'Food'], [45000, 30000, 18000])
plt.ylabel('Revenue ($)')You want to show the distribution of customer ages in your database (thousands of customers). Which chart is correct?
- ALine chart — age is a continuous variable
- BBar chart — one bar per age
- CHistogram — shows how many customers fall in each age range
- DPie chart — shows age proportions