Skip to content

AlgebraOfGraphics

An algebraic spin on grammar-of-graphics data visualization powered by Makie.jl

AlgebraOfGraphics

Welcome to AlgebraOfGraphics!

AlgebraOfGraphics (AoG) defines a language for data visualization, inspired by the grammar-of-graphics system made popular by the R library ggplot2. It is based on the plotting package Makie.jl which means that most capabilities of Makie are available, and AoG plots can be freely composed with normal Makie figures.

Example

In AlgebraOfGraphics, a few simple building blocks can be combined using + and * to quickly create complex visualizations, like this:

julia
using AlgebraOfGraphics, CairoMakie, PalmerPenguins, DataFrames

penguins = dropmissing(DataFrame(PalmerPenguins.load()))

spec =
    data(penguins) *
    mapping(
        :bill_length_mm => "Bill length (mm)",
        :bill_depth_mm => "Bill depth (mm)",
        color = :species => "Species",
        row = :sex,
        col = :island,
    ) *
    (visual(Scatter, alpha = 0.3) + linear())

draw(spec)

Installation

You can install AlgebraOfGraphics from the General Registry with the usual Pkg commands:

julia
using Pkg
Pkg.add("AlgebraOfGraphics")

First steps

Have a look at the Getting started 🐧 tutorial to get to know AlgebraOfGraphics!