Data Science Center

Twelve labs, thirty-plus interactive experiments, a project studio that analyses your files locally, a dataset library, learning paths and a specialised assistant.

41interactive experiments

Data Science Center

Data Visualization Lab

Choosing the right chart, avoiding distortion, accessibility.

  • 3lessons
  • 4experiments
  • 5terms
عربي

Scientific introduction

A good chart makes the pattern obvious; a bad one hides or distorts it. The choice rests on variable types, the question asked, and how well human perception can compare the encoded values.

Learning objectives

  • Pick the right chart for the question and data
  • Read histograms, box plots, scatter plots and heatmaps
  • Avoid distortion (truncated axes, area, colour)
  • Design charts that work for colour-blind readers and screen readers

Topics

  • Chart types
  • Perception
  • Distortion
  • Accessibility

Core concepts

Histogram
A chart counting observations in consecutive bins of a numeric variable.
Box plot
A chart summarising the median, quartiles, range and outliers.
Heatmap
A chart that represents matrix values with colour intensity.
Chartjunk
Decorative elements that carry no information and distract the reader.
Colour-blind-safe palette
A palette whose colours stay distinguishable under common colour-vision deficiencies.

Theory

Choosing the right chart

Start from the question

  • Comparing categories: bars (horizontal when names are long).
  • Distribution of a numeric variable: histogram or box plot.
  • Relationship between two numeric variables: scatter plot.
  • Change over time: line.
  • Patterns in a table: heatmap.

Avoid pie charts beyond 3-4 categories, and avoid decorative 3-D, which distorts comparison.

Honest charts: avoiding distortion

Common sources of distortion

  • A vertical axis that does not start at zero for bars, so small differences look large.
  • Scaling radius instead of area in symbolic charts.
  • Colours without meaning, or an uneven gradient.
  • Dropping an inconvenient stretch of a time series.

Rule: visual ink should be proportional to the value. For lines the axis may start above zero, provided it is clearly marked.

Charts everyone can read

Colour and markers

About 8% of men have some form of colour-vision deficiency. Do not rely on colour alone: use different marker shapes, dash patterns and direct labels. Choose a safe palette such as Okabe-Ito.

Screen readers

Give each chart a title, alt text and a readable data table. The charts in this center show their data table beneath.

Worked examples

Why pie charts compare poorly

Judging angles and areas is less accurate than judging lengths on a common axis, so bars are preferred when comparing many categories.

Interactive experiments

Beginner Synthetic data

Chart builder

Learning goal: Choose chart type and aggregation and notice how the choice changes the reading.

Explanation and scientific documentation

You choose the two variables, the chart type (bar, line, scatter, pie…) and an aggregate.

Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.

Bars compare categories, lines show time, scatter shows the relation of two numeric variables.

Limits: A chart is a tool; the question determines its type.

Intermediate Synthetic data

Box plot explorer

Learning goal: Read median, quartiles and outliers and compare groups.

Explanation and scientific documentation

A numeric variable is drawn grouped by a category, with a violin option to show the full shape.

Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.

The box spans Q1 to Q3 and whiskers reach the furthest value within 1.5×IQR.

Limits: A box hides multimodality, so pair it with a violin or histogram.

Intermediate Synthetic data

Scatter plot explorer

Learning goal: See the relation between two variables and the effect of grouping and a trend line.

Explanation and scientific documentation

A scatter plot is shown with an optional regression line and colouring by group.

Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.

A trend can reverse within each group compared with the overall trend (Simpson's paradox).

Limits: A regression line is a description, not causal evidence.

Intermediate Synthetic data

Heatmap explorer

Learning goal: Read patterns of a table through colour and understand the colour scale.

Explanation and scientific documentation

A correlation matrix or group means across two categories are drawn as a heatmap.

Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.

Colour encodes value; use a single-hue ramp for sequential values and a diverging scale around zero for correlation.

Limits: Colour is less accurate than length for comparison; show numbers when needed.

Related algorithms and methods

Histogram

Splits the range into bins and counts observations per bin.

Box plot

Summarises median, quartiles and outliers.

Suitable datasets

Practical projects

Assessment questions

Sources and references

  1. Cleveland, W. S., & McGill, R. (1984). Graphical perception: Theory, experimentation, and application to the development of graphical methods. Journal of the American Statistical Association, 79(387), 531-554 DOI (bibliographic data entered by the editor, not machine-checked)
  2. Tufte, E. R. (2001). The Visual Display of Quantitative Information (2nd ed.). Graphics Press (bibliographic data entered by the editor, not machine-checked)
  3. Wilkinson, L. (2005). The Grammar of Graphics (2nd ed.). Springer DOI (bibliographic data entered by the editor, not machine-checked)