The grammar of graphics

Introduzione alla visualizzazione dei dati con ggplot2

Rick Scavetta

Founder, Scavetta Academy

The quick brown fox jumps over the lazy dog

Introduzione alla visualizzazione dei dati con ggplot2

The quick brown fox jumps over the lazy dog

Introduzione alla visualizzazione dei dati con ggplot2

Grammar of graphics

  • Plotting framework
  • Leland Wilkinson, Grammar of Graphics, 1999
  • 2 principles
    • Graphics = distinct layers of grammatical elements
    • Meaningful plots through aesthetic mappings

Introduzione alla visualizzazione dei dati con ggplot2

The three essential grammatical elements

Element Description
Data The data-set being plotted.
Aesthetics The scales onto which we map our data.
Geometries The visual elements used for our data.
Introduzione alla visualizzazione dei dati con ggplot2

Course 1: core competency

Element Description
Data The data-set being plotted.
Aesthetics The scales onto which we map our data.
Geometries The visual elements used for our data.
Themes All non-data ink.
Introduzione alla visualizzazione dei dati con ggplot2

The seven grammatical elements

Element Description
Data The data-set being plotted.
Aesthetics The scales onto which we map our data.
Geometries The visual elements used for our data.
Themes All non-data ink.
Statistics Representations of our data to aid understanding.
Coordinates The space on which the data will be plotted.
Facets Plotting small multiples.
Introduzione alla visualizzazione dei dati con ggplot2

Jargon for each element

Introduzione alla visualizzazione dei dati con ggplot2

Course 2: Tools for EDA

  • Remaining 3 layers
  • Best practices for Data Viz
Introduzione alla visualizzazione dei dati con ggplot2

Let's practice!

Introduzione alla visualizzazione dei dati con ggplot2

Preparing Video For Download...