The grammar of graphics is a framework for data visualization. The original grammar of graphics framework was proposed by Dr. Leland Wilkinson in the book [The Grammar of Graphics](https://link.springer.com/book/10.1007/0-387-28695-0). Hadley Wickham built on this to create his [layered grammar of graphics](https://vita.had.co.nz/papers/layered-grammar.html) which he implemented in the [[R]] package [[ggplot2]]. In [[Python]] the grammar of graphics framework underlies the package [[Altair]]. The **layered grammar of graphics** uses the following major components to build data visualizations up: 1. **Data**: always start with the data 2. **Mapping** (aesthetics): how the data are mapped onto aesthetic attributes of geometric objects 3. **Layers** (geometric objects and statistics): geometry such as shape, size and color; statistical information including raw/transformed data or regression lines; and position adjustments 4. **Scales**: pair with aesthetic attributes and are represented by axes or legends 5. **Facets**: subplots 6. **Coordinate system**: cartesian, polar, etc. 7. **Theme**: the overall look/feel of the plot > [!tip]- Additional Resources > - [A Comprehensive Guide to the Grammar of Graphics for Effective Visualization of Multi-dimensional Data](https://towardsdatascience.com/a-comprehensive-guide-to-the-grammar-of-graphics-for-effective-visualization-of-multi-dimensional-1f92b4ed4149) (Dipanjan (DJ) Sarkar: Towards Data Science)