ggplot2 is R's most powerful data visualization package, built on the Grammar of Graphics—a systematic framework that treats plots as compositions of independent layers (data, aesthetics, geometries, statistics, scales, coordinates, and facets). Originally created by Hadley Wickham, ggplot2 is now the industry standard for publication-quality graphics in R, integrated deeply into the tidyverse ecosystem. Unlike base R plotting, which describes what to draw, ggplot2 describes how variables map to visual properties, enabling you to build complex visualizations incrementally. The key mental model: every plot is a layered combination of components you add with +, where changing one layer (e.g., swapping geom_point() for geom_line()) transforms the visualization without rewriting the entire plot.
Share this article