Back to List

Choosing the Right Chart for Your Data

Comparison, trends, distribution, relationships, composition β€” learn how to choose the right chart based on what your data wants to tell you.

Beginner
|
8min
|
Verified (2026-07)
chart typevisualization selectionbar graphline graphhistogramscatter plot
Progress0/17 (0%)

Choosing the Right Chart for Your Data

After completing this topic:

You will be able to determine the appropriate chart type based on what your data is trying to convey.


Ask yourself first:

Before choosing a chart, first determine "what you want to show with this data." Even the same data can be represented with different charts depending on the purpose.

What you want to showChart type
Size comparisonBar chart
Change over timeLine chart
Distribution (how spread out)Histogram, box plot
Relationship between two variablesScatter plot
Proportion relative to the wholePie chart, stacked bar chart

1. Comparison - Bar Chart

Most effective for comparing sizes between categories, such as "sales by department" or "population by country."

python
sns.barplot(data=df, x='department', y='revenue')

Rules:

  • If there are many items, a horizontal bar chart is easier to read.
  • It must start at 0 β€” starting at 100 exaggerates the differences.
  • The order of items is generally sorted by value (not alphabetically).

2. Trend - Line Chart

Shows changes over time, such as "monthly sales" or "daily visitors."

python
sns.lineplot(data=df, x='month', y='revenue')

Rules:

  • The x-axis is time β€” if a category is on the x-axis, it's a bar chart, not a line chart.
  • When overlapping multiple lines, keep it to 3 or fewer β€” more than that becomes a "spaghetti" chart.
  • An area chart can show both the overall trend and changes relative to the whole.

3. Distribution - Histogram, Box Plot

Used to understand "how salaries are distributed" or "whether there are outliers."

python
# Histogram β€” frequency distribution
sns.histplot(data=df, x='salary', bins=20)
# Box plot β€” median, quartiles, outliers
sns.boxplot(data=df, x='department', y='salary')
HistogramBox plot
ShowsOverall distribution shapeSummary statistics (median/quartiles/outliers)
StrengthsShows the number of peaks and whether it is skewedGood for comparing groups and identifying outliers
WeaknessesDifficult to compare groupsDoes not show detailed distribution shape

4. Relationship - Scatter Plot

Examines the relationship between two numerical variables, such as "does salary increase with experience?"

python
sns.scatterplot(data=df, x='experience', y='salary', hue='department')

If the points form a linear pattern, there is a correlation; if they are scattered, there is no correlation. This was discussed in detail in the previous topic (heatmap and scatter plot).


5. Composition - Pie Chart (Use with caution)

Shows "the proportion of each part relative to the whole."

python
plt.pie(sizes, labels=labels, autopct='%1.1f%%')

Reasons to avoid pie charts:

  • It is difficult to distinguish between similar-sized slices β€” it is difficult to perceive the difference between 28% and 32% in terms of the angle of the pie slice.
  • It becomes almost unreadable if there are more than 5 items.

Alternative: A horizontal stacked bar chart is more effective for comparing proportions. Comparing lengths is more in line with human cognitive abilities than comparing angles.


Chart Selection Flowchart

text
What do you want to show with the data?
β”‚
β”œβ”€ Size comparison ────────→ Bar chart
β”‚
β”œβ”€ Change over time ────────→ Line chart
β”‚
β”œβ”€ Distribution/outliers ──────→ Histogram or box plot
β”‚
β”œβ”€ Relationship between two variables ─────→ Scatter plot
β”‚
β”œβ”€ Correlation between multiple variables ───→ Heatmap
β”‚
└─ Proportion relative to the whole ───→ Stacked bar chart (avoid pie charts)

Common problems with bad visualizations

  1. 3D charts β€” perspective distorts size.
  2. Dual Y-axis β€” two scales create false correlations.
  3. Y-axis does not start at 0 β€” small differences appear large.
  4. Excessive use of colors β€” rainbow colors are flashy but distracting.
  5. No labels β€” charts without axis names, units, or titles are unreadable.

A good visualization allows you to understand "what this data is saying" within 5 seconds.


Key takeaway

Don't choose a chart first β€” decide "what you want to show" first. Use bar charts for comparisons, line charts for trends, histograms/box plots for distributions, scatter plots for relationships, and stacked bar charts for overall proportions. Avoid pie charts, and avoid 3D and dual Y-axes β€” simple and honest charts are good charts.

πŸ’¬ Questions & Comments

0 comments

You can post without signing in. Guest comments cannot be edited or deleted by their author.

0/2000

Loading...