Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

ggplot2: Colour Scales and Legends

The chapter covers how to use colour scales and legends in ggplot2, including the use of scale_colour_* and scale_fill_* functions to map data to colours, and how to customise legend appearance.

Background

- **ggplot2** is the most widely used data-visualization package for the R programming language. It implements a "grammar of graphics" — a layered system for building plots from data, aesthetics (e.g., x/y position, color, size), and geometric objects (bars, points, lines).

Related stories