A Julia package that mirrors the behaviour of MATLAB's plotmatrix using CairoMakie. It produces a grid of scatter plots and marginal histograms for every pair of dimensions in a multidimensional dataset.
Up to three datasets can be overlaid in the same figure for visual comparison.
using Pkg
Pkg.add(url="https://github.com/lukasfritsch/PlotMatrix.jl")using PlotMatrix
x = randn(500, 4) # 500 observations, 4 variables
y = randn(300, 4) .+ 1.5
z = randn(300, 4) .- 1.5
# style = :compact (default)
fig_compact = plotmatrix(x, y, z;
dimlabels = ["A", "B", "C", "D"],
style = :compact, # :compact | :full | :corr
legend_labels = ["Group 1", "Group 2", "Group 3"],
alphas = (0.7, 0.7, 0.7)
)# style = :corr
fig_corr= plotmatrix(x, y, z;
dimlabels = ["A", "B", "C", "D"],
style = :corr, # :compact | :full | :corr
legend_labels = ["Group 1", "Group 2", "Group 3"],
alphas = (0.7, 0.7, 0.7)
)| Keyword | Default | Description |
|---|---|---|
style |
:compact |
:compact (lower triangle), :full (all pairs), :corr (correlations in upper triangle) |
dimlabels |
column indices | Axis labels |
palette |
:auto |
Color palette (Wong colors by default) |
alphas |
(1,1,1) |
Opacity for each dataset |
bins |
30 |
Histogram bins |
legend_position |
:right |
:right or :bottom |
legend_labels |
"data1", … |
Legend entry labels |
markersize |
4 |
Scatter marker size |