Course contentsShow
← Data Science
Lesson 1238 of 2,14531. Data Visualization PrinciplesFree lesson

Matching Encoding to Data Type

Choosing appropriate visual channels for nominal, ordinal, interval, and ratio data types.

Matching Encoding to Data Type

You'll learn how to pair the right visual channels (position, color, size, etc.) with nominal, ordinal, interval, and ratio data types for maximum clarity.

The Core Problem

Not all visual encodings work equally well for every data type. Using the wrong pairing creates confusion—imagine encoding temperature with unordered colors, or representing categories with bar heights that imply mathematical differences that don't exist.

The Four Data Type-Encoding Pairings

Nominal data (categories with no order: fruit types, countries, product names) pairs best with:

  • Hue (different colors)
  • Shape (circles vs. squares)
  • Spatial grouping (separate positions, but not ordered)

Avoid using size or position along a scale—these imply order or magnitude that nominal data lacks.

Ordinal data (ordered categories: small/medium/large, satisfaction ratings) works with:

  • Ordered position (left-to-right or top-to-bottom)
  • Saturation/luminance (lighter to darker shades)
  • Size (acceptable if order is clear)

Use encodings that preserve the inherent ordering.

Interval data (numeric with no true zero: temperature in Celsius, dates) suits:

  • Position along an axis (the most accurate encoding)
  • Length (bar charts)

These support addition and subtraction comparisons.

Ratio data (numeric with meaningful zero: height, count, salary) leverages:

  • Position (still most accurate)
  • Length
  • Area or volume (acceptable since ratios are meaningful: "twice as much")

The Hierarchy Reminder

Always prefer position when possible (most accurate), but match secondary channels to what your data can and should convey. Don't use area for ordinal data—the perceptual system will read ratios that aren't meaningful.

Key Takeaway: Match visual encodings to data type capabilities—nominal gets hue/shape, ordinal gets ordered encodings, and interval/ratio get positional and quantitative channels that respect their mathematical properties.