jointplot
Mojo module 🡭
jointplot
A bivariate chart with each variable’s own distribution beside it (#354).
A scatter of y against x, a histogram of x along the top, and a
histogram of y down the right side.
It is the natural chart for “are these two related, and what does each look like on its own”, and the answer is often that a convincing-looking correlation is driven by a bimodal marginal the scatter alone does not show.
The layout is the feature. A marginal has to sit over the panel it
describes: a value at the main panel’s pixel p must appear at pixel
p in the strip above it, or the figure is telling you the mass is
somewhere it is not. Two things make that true here, and neither is
free.
The domains are pinned. Each marginal takes its bin range from the main panel’s own padded extent rather than from its own data, so the strip covers exactly the span the scatter does.
The pixels are aligned. Equal domains are not enough: each cell sizes
its margins from its own tick labels, and a marginal counts observations
while the panel shows the data, so their labels differ in width and
their plot rects would start at different pixels. render_grid’s
align_axes measures every cell and puts a column on one pair of
vertical edges (#569). That is the piece this chart was waiting on.
The corner opposite the two marginals is left empty and takes the figure background rather than showing through.