API Documentation

PairPlots.pairplotFunction
pairplot(inputs...; figure=(;), kwargs...)

Convenience method to generate a new Makie figure with resolution (800,800) and then call pairplot as usual. Returns the figure.

Example:

fig = pairplot(table)
source
pairplot(gridpos::Makie.GridPosition, inputs...; kwargs...)

Create a pair plot at a given grid position of a Makie figure.

Example

fig = Figure()
pairplot(fig[2,3], table)
fig
source
pairplot(gridpos::Makie.GridLayout, inputs...; kwargs...)

Convenience function to create a reasonable pair plot given one or more inputs that aren't full specified. Wraps input tables in PairPlots.Series() with a distinct color specified for each series.

Here are the defaults applied for a single data table:

pairplot(fig[1,1], table) == # approximately the following:
pairplot(
    PairPlots.Series(table, color=Makie.RGBA(0., 0., 0., 0.5)) => (
        PairPlots.HexBin(colormap=Makie.cgrad([:transparent, :black]),bins=32),
        PairPlots.Scatter(filtersigma=2), 
        PairPlots.Contour(),
        PairPlots.MarginDensity(
            color=:transparent,
            color=:black,
            linewidth=1.5f0
        ),
        PairPlots.MarginConfidenceLimits()
    )
)

Here are the defaults applied for 2 to 5 data tables:

pairplot(fig[1,1], table1, table2) == # approximately the following:
pairplot(
    PairPlots.Series(table1, color=Makie.wong_colors(0.5)[1]) => (
        PairPlots.Scatter(filtersigma=2), 
        PairPlots.Contourf(),
        PairPlots.MarginDensity(
            linewidth=2.5f0
        )
    ),
    PairPlots.Series(table2, color=Makie.wong_colors(0.5)[2]) => (
        PairPlots.Scatter(filtersigma=2), 
        PairPlots.Contourf(),
        PairPlots.MarginDensity(
            linewidth=2.5f0
        )
    ),
)

For 6 or more tables, the defaults are approximately:

PairPlots.Series(table1, color=Makie.wong_colors(0.5)[series_i]) => (
    PairPlots.Contour(sigmas=[1]),
    PairPlots.MarginDensity(
        linewidth=2.5f0
    )
)
source
pairplot(gridpos::Makie.GridLayout, inputs...; kwargs...)

Main PairPlots function. Create a pair plot by plotting into a grid layout within a Makie figure.

Inputs should be one or more Pair of PairPlots.AbstractSeries => tuple of VizType.

Additional arguments:

  • labels: customize the axes labels with a Dict of column name (symbol) to string, Makie rich text, or LaTeX string.
  • diagaxis: customize the Makie.Axis of plots along the diagonal with a named tuple of keyword arguments.
  • bodyaxis: customize the Makie.Axis of plots under the diagonal with a named tuple of keyword arguments.
  • axis: customize the axes by parameter using a Dict of column name (symbol) to named tuple of axis settings. x and y are automatically prepended based on the parameter and subplot. For global properties, see diagaxis and bodyaxis.
  • legend: additional keyword arguments to the Legend constructor, used if one or more series are labelled. You can of course also create your own Legend and inset it into the Figure for complete control.

Examples

Basic usage:

table = (;a=randn(1000), b=randn(1000), c=randn(1000))
pairplot(table)

Customize labels:

pairplot(table, labels=Dict(:a=>L"\sum{a^2}"))

Use a pseudo log scale for one variable:

pairplot(table, axis=(; a=(;scale=Makie.pseudolog10) ))
source
PairPlots.SeriesType
Series(data; label=nothing, kwargs=...)

A data series in PairPlots. Wraps a Tables.jl compatible table. You can optionally pass a label for this series to use in the plot legend. Keyword arguments are forwarded to every plot call for this series.

Examples:

ser = Series(table; label="series 1", color=:red)
source
Series(matrix::AbstractMatrix; label=nothing, kwargs...)

Convenience constructor to build a Series from an abstract matrix. The columns are named accordingly to the axes of the Matrix (usually :1 though N).

source
PairPlots.TruthType
Truth(truths; labels=nothing, kwargs=...)

Mark a set of "true" values given by truths which should be either a named tuple, Dict, etc that can be indexed by the column name and returns a value or values.

source
PairPlots.VizTypeDiagType

" VizTypeBody

A type of PairPlots vizualization that only shows one variable. Used for the plots along the diagonal.

source
PairPlots.HexBinType
HexBin(;kwargs...)

Plot two variables against eachother using a Makie Hex Bin series. kwargs are forwarded to the plot function and can be used to control the number of bins and the appearance.

source
PairPlots.HistType
Hist(;kwargs...)
Hist(histprep_function; kwargs...)

Plot two variables against eachother using a 2D histogram heatmap. kwargs are forwarded to the plot function and can be used to control the number of bins and the appearance.

Note

You can optionally pass a function to override how the histogram is calculated. It should have the signature: prepare_hist(xs, ys, nbins) and return a vector of horizontal bin centers, vertical bin centers, and a matrix of weights.

Tip

Your prepare_hist function it does not have to obey nbins

source
PairPlots.ContourType
Contour(;sigmas=1:2, bandwidth=1.0, kwargs...)

Plot two variables against eachother using a contour plot. The contours cover the area under a Gaussian given by sigmas, which must be <: AbstractVector. kwargs are forwarded to the plot function and can be used to control the appearance.

KernelDensity.jl is used to produce smoother contours. The bandwidth of the KDE is chosen automatically by that package, but you can scale the bandwidth used up or down by a constant factor by passing bandwidth when creating the series. For example, bandwidth=2.0 will double the KDE bandwidth and result in smoother contours.

Note

Contours are calculated using Contour.jl and plotted as a Makie line series.

See also: Contourf

source
PairPlots.ContourfType
Contourf(;sigmas=1:2, bandwidth=1.0, kwargs...)

Plot two variables against eachother using a filled contour plot. The contours cover the area under a Gaussian given by sigmas, which must be <: AbstractVector. kwargs are forwarded to the plot function and can be used to control the appearance.

KernelDensity.jl is used to produce smoother contours. The bandwidth of the KDE is chosen automatically by that package, but you can scale the bandwidth used up or down by a constant factor by passing bandwidth when creating the series. For example, bandwidth=2.0 will double the KDE bandwidth and result in smoother contours.

KernelDensity.jl is used to produce smoother contours.

See also: Contour

source
PairPlots.ScatterType
Scatter(;kwargs...)

Plot two variables against eachother using a scatter plot.kwargs are forwarded to the plot function and can be used to control the appearance.

source
PairPlots.MarginHistType
MarginHist(;kwargs...)
MarginHist(histprep_function; kwargs...)

Plot a marginal filled histogram of a single variable along the diagonal of the grid. kwargs are forwarded to the plot function and can be used to control the number of bins and the appearance.

Tip

You can optionally pass a function to override how the histogram is calculated. It should have the signature: prepare_hist(xs, nbins) and return a vector of bin centers and a vector of weights.

Note

Your prepare_hist function it does not have to obey nbins

source
PairPlots.MarginStepHistType
MarginStepHist(;kwargs...)
MarginStepHist(histprep_function; kwargs...)

Plot a marginal histogram without filled columns of a single variable along the diagonal of the grid. kwargs are forwarded to the plot function and can be used to control the number of bins and the appearance.

Tip

You can optionally pass a function to override how the histogram is calculated. It should have the signature: prepare_hist(xs, nbins) and return a vector of bin centers and a vector of weights.

Note

Your prepare_hist function it does not have to obey nbins

source
PairPlots.MarginDensityType
MarginDensity(;kwargs...)

Plot the smoothed marginal density of a variable along the diagonal of the grid, using Makie's density function. kwargs are forwarded to the plot function and can be used to control the appearance.

source