How to Add a Table to a Matplotlib Plot
Put a data table under or beside a Matplotlib chart with ax.table(), then control its size, fonts, colors, and column widths.
Put a data table under or beside a Matplotlib chart with ax.table(), then control its size, fonts, colors, and column widths.
Zoom, pan, add sliders, and respond to clicks on Matplotlib figures in JupyterLab, Notebook, VS Code, and Colab with ipympl.
Make Matplotlib charts for dark slides, dashboards, and websites with dark_background, a custom dark theme, and light and dark exports from one function.
Plot vector fields in Matplotlib: arrows on a grid with ax.quiver() and continuous flow lines with ax.streamplot().
Add stripes, crosses, and dots to bars, areas, and pie wedges with the hatch argument, and control the pattern's color, density, and line width.
Draw values that hold and then jump with ax.step() and ax.stairs(), and show discrete samples with ax.stem().
Show the density of thousands of points with ax.hexbin() and ax.hist2d(), with log color scales, marginal histograms, and per-bin averages.
Add a small chart inside a Matplotlib chart with inset_axes(), zoom into one region, and draw connector lines with indicate_inset_zoom().
Skip an empty range on the y-axis or x-axis by splitting a Matplotlib chart into two subplots with different limits and drawing the break marks.
Use set_aspect() to give x and y the same scale, set_box_aspect() to fix the shape of the plot, and know which one you need.
A map of the Matplotlib tutorials: the basics, chart types, axes and ticks, legends and text, layouts, styling, and saving figures.
Draw sparklines with Matplotlib: a stack of tiny line charts with last values, min and max markers, reference bands, a grid of small multiples and inline PNGs for HTML tables.
Turn a from-to table into a chord diagram with pyCirclize, add direction arrows, set colors, highlight one group and know when a heatmap is clearer.
Build a Marimekko chart with variable-width Matplotlib bars, label it, and make mosaic plots of categorical data with statsmodels.
Draw a forest plot of odds ratios with Matplotlib, pool studies with fixed and random effects, and add the table columns journals expect.
Compare two measurement methods with a Bland-Altman plot: mean difference, limits of agreement, confidence intervals and what to do when the spread grows with size.
Draw bullet charts with layered Matplotlib bars to compare a value with a target and performance bands, for one KPI or a whole stack.
Draw stream graphs with stackplot, compare the four baseline options, smooth the layers and label them directly.
Build a bubble chart with ax.scatter, scale bubble areas correctly, color by group, add a size legend and label the points.
Draw clean causal diagrams with NetworkX and Matplotlib, list backdoor paths, choose adjustment variables, and see what controlling for a collider does.