[ANN] A Package for Generating Corner Plots (PairPlots.jl)

New Feature: full grid of plots above and below the diagonal

Thanks @aplavin for the feature request! PairPlots.jl now supports displaying a full grid of plots if you pass the fullgrid=true option:

N = 100000
α = [2randn(N÷2) .+ 6; randn(N÷2)]
β = [3randn(N÷2); 2randn(N÷2)]
γ = randn(N)
δ = β .+ 0.6randn(N)
df = (;α, β, γ, δ);

pairplot(df, fullgrid=true)

Adding a legend is currently not supported when combined with a full grid plot but will be added back in a future version.

While we’re at it, here’s a demo of just some of the ways you can customize the look of a pair plot:


using PairPlots, CairoMakie

N = 100000
θ = 8rand(N) .+ 0.1 .* randn.()
r = atan.(θ) .+ 0.1 .* randn.()
x = r.*cos.(θ) 
y = r.*sin.(θ) 
tbl = (;x,y,θ,r=r.^2)


fig = Figure(
    size=(1000,500)
)
pairplot(
    fig[1,1],
    tbl => (
        PairPlots.Hist(sigmas=[3],color=:black, linewidth=2),
        PairPlots.Contour(sigmas=[1],color=:blue, linewidth=2),
        PairPlots.Scatter(markersize=1 ,color=(:blue,1), filtersigma=3),
        PairPlots.MarginDensity(color=:white),
        PairPlots.MarginConfidenceLimits(color=:orange, linestyle=:dot, linewidth=5)
    ),
    PairPlots.Truth(
        (;x = 0, y=0),
        color=:darkred    
    ),
    fullgrid=true,
    labels = Dict(
        :θ => "angle θ",
        :r => Makie.rich("radius r", font=:bold, color=:red),
        :x => L"\sum_i^N{x_i}",
        :y => Makie.rich("position y", font=:italic)
    ),
    bodyaxis=(;
        aspect=1,
        backgroundcolor=:lightgray
    ),
    diagaxis=(;
        backgroundcolor=:black
    )
)

ax = Axis3(fig[1,2])
scatter!(ax,x,y,r,markersize=1)
hidedecorations!(ax)
Makie.Label(fig[0,:], "Super Title", fontsize=20)
fig

Future Roadmap

The next major feature I would like to land is support for the new Makie declarative API. It’s my understanding that adopting this API will make it so that PairPlots can be animated, or updated live while eg an MCMC run is sampling. I’ll aim to do this as soon as the new API is stabilized by the Makie team.

Another feature request is for categorical axes. A contribution in the form of a PR adding this feature would be well-received.

Thanks all, and keep the feature requests coming!