Theme Gallery¶
Each predefined theme has a card here: a ledger of its series colors with hex
codes, its singular, heatmap and diverging colormaps, the font it sets in and
its colour-blindness scores, and the same
six signature charts rendered under that theme ā grouped bars, lines, a fitted
scatter, a box plot, a heatmap, and a twin-axis Panel. The six charts cover
every trait a theme can differ in: palette, edges and fills, line strokes and
markers, bodies, value scales, and the furniture around them (spines, grid,
ticks, legend). The themes are grouped by where they work best:
| Theme | Character |
|---|---|
| Screen and presentations | |
THEME.DEFAULT | Softened OkabeāIto palette, colour-blind safe, open spines, soft grid. |
THEME.MATERIAL | Google hues re-stepped for deutan readers, bottom spine only, light grid. |
THEME.MINIMAL | Accent violet with five stepped greys, no spines, flat bars. |
THEME.HARBOR | Navy and amber in lightness steps, colour-blind safe. |
THEME.DARK | Bright marks on a near-black page, light furniture, Viridis value scale. |
| Print and black-and-white | |
THEME.GREYSCALE | Five greys with hatch, dash and marker cycles, print-friendly. |
THEME.INK | Lightness-stepped YlGnBu palette with navy ink accents. |
THEME.HATCH | Six-entry hatch cycle, black edges, light grid. |
THEME.MUTED | Tol's muted colours, dash and marker cycles, colour-blind safe. |
THEME.CONTRAST | Lightness-stepped colours plus hatches, print-safe. |
THEME.MUTEDHATCH | Tol's muted colours under hatches, BuPu value scale. |
THEME.SLATEHATCH | The hatch theme without rust: slate blue first, PuBu value scale. |
| Illustrative | |
THEME.SKETCH | Hand-drawn wobble and halo, Comic Neue font, no grid. |
THEME.QUILL | Black ink on white paper: pen strokes, etched fills, IM Fell English font. |
Themes also carry defaults for chart settings: every theme but SKETCH and
QUILL shows a muted y-grid unless a chart call sets show_grid itself, and
HATCH hatches bar series via its hatch cycle, which is why the very same
chart code below renders with grids and hatches that differ per theme. An
explicit setting always wins.
A theme with a different hue is not a new card: derive_theme in the
Themes guide rebuilds any
theme's palettes from a colormap in
COLORS and keeps
its furniture.
The sample data and the two helpers behind every card are defined in a hidden
cell. show_swatches() reads the palette, the colormaps and the font straight
from the active config, so the ledger always matches the theme as shipped.
Its last row is the theme's colour-blindness scores from score_palette, as
explained in the next section; cvd_table() lists them for every theme.
signature(pair) builds the six charts with the very same code for every theme;
pair supplies the two colors the twin-axis panel styles explicitly (one per
axis), picked from the theme's own swatches. Each card opens with the one call
that selects the theme.
Colour-blindness suitability¶
A reader compares any two series on a chart, so every theme is scored on its worst pair of palette colours, not only on neighbouring ones. Each colour is passed through the Machado, Oliveira and Fernandes (2009) simulation of deuteranopia, protanopia and tritanopia at full severity, and the distance between the two closest colours is measured in the OKLab colour space (ĪE, Ć100). Normal is the same distance without simulation, and greyscale gap is the smallest lightness step between two colours once the chart is printed without colour.
A theme passes when the worst pair stays at ĪE 8 or more for both deutan
and protan readers and at 15 or more for everyone; between 6 and 8 it is
weak, acceptable only where a second cue (dashes, markers, hatches) tells
the series apart; below that it fails. Tritan scores are reported but not
gated, since that deficiency is rare. The scoring is score_palette, the same function register_theme warns through when a palette fails, and a test holds every predefined theme to the gate. QUILL has one ink and no score; GREYSCALE and MINIMAL separate their greys by lightness alone, which every reader sees alike, and carry pattern cycles or an accent for the rest.
cvd_table()
| Theme | Series | Deutan | Protan | Tritan | Normal | Greyscale gap | Verdict |
|---|---|---|---|---|---|---|---|
| Screen and presentations | |||||||
default | 6 | 10.8 | 12.8 | 8.3 | 15.7 | 0 | pass |
material | 6 | 8.2 | 11.1 | 5.8 | 15.3 | 0 | pass |
minimal | 6 | 15.5 | 15.5 | 7.0 | 15.5 | 3 | pass |
harbor | 6 | 16.1 | 13.8 | 15.3 | 15.6 | 0 | pass |
dark | 6 | 11.0 | 11.6 | 13.1 | 19.5 | 1 | pass |
| Print and black-and-white | |||||||
greyscale | 5 | 15.7 | 15.7 | 15.8 | 15.7 | 16 | pass |
ink | 5 | 13.8 | 14.2 | 13.7 | 15.7 | 15 | pass |
hatch | 6 | 12.0 | 11.1 | 8.5 | 15.9 | 3 | pass |
muted | 5 | 17.3 | 10.5 | 16.0 | 17.8 | 3 | pass |
contrast | 5 | 10.1 | 12.6 | 12.1 | 15.3 | 9 | pass |
mutedhatch | 5 | 17.3 | 10.5 | 16.0 | 17.8 | 3 | pass |
slatehatch | 6 | 9.6 | 9.9 | 8.6 | 17.7 | 1 | pass |
| Illustrative | |||||||
sketch | 5 | 9.5 | 9.9 | 14.7 | 15.2 | 6 | pass |
quill | 1 | one ink; series differ by pattern | ā | ||||
Screen and presentations¶
Colorful categorical palettes for notebooks, dashboards and slides, on
light furniture except DARK, which inverts it.
Default¶
The modernized default: a softened OkabeāIto palette closed with charcoal, so every pair of series stays apart for colour-blind readers; white bar edges, open spines, soft y-grid from the theme default.
Selected with THEME.DEFAULT; the full attribute set is DEFAULT_THEME.
config.set_theme(THEME.DEFAULT)
show_swatches()
signature(pair=("#3B76B0", "#C24E2A")).show()
#3B76B0#E8A63E#2F9E82#C24E2A#7CBCE4#444444BluesBluesPuOrHelveticaColour-blindness, worst pair ĪE: deutan 10.8 Ā· protan 12.8 Ā· tritan 8.3 Ā· normal 15.7 Ā· greyscale gap 0 Ā pass
Material¶
The Google hues in brand order, blue, red, yellow, green, cyan and violet, re-stepped in lightness so red and green stay apart for deutan readers; a bottom spine only and a light solid grid.
Selected with THEME.MATERIAL; the full attribute set is MATERIAL_THEME.
config.set_theme(THEME.MATERIAL)
show_swatches()
signature(pair=("#1A73E8", "#BC261D")).show()
#1A73E8#BC261D#EFB04E#269F47#19ACC1#7C48B5BluesBluesPuOrRobotoColour-blindness, worst pair ĪE: deutan 8.2 Ā· protan 11.1 Ā· tritan 5.8 Ā· normal 15.3 Ā· greyscale gap 0 Ā pass
Minimal¶
Accent violet with five greys stepped in lightness, dark and light interleaved, no spines or tick marks, flat bars.
Selected with THEME.MINIMAL; the full attribute set is MINIMAL_THEME.
config.set_theme(THEME.MINIMAL)
show_swatches()
signature(pair=("#7048E8", "#1B242C")).show()
#7048E8#1B242C#A2AEB9#414C58#D3E0EA#6D7983PurplesPurplesRdBuHelveticaColour-blindness, worst pair ĪE: deutan 15.5 Ā· protan 15.5 Ā· tritan 7.0 Ā· normal 15.5 Ā· greyscale gap 3 Ā pass
Harbor¶
Navy to sky and amber to sand, stepped in lightness, with taupe and near-black closing the set. Two hue families keep the chart reading as one palette, and every pair of series stays apart for deutan, protan and tritan readers.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.Harbor, traits=[TRAIT.FLAT]) with the Cividis value scale. Selected with THEME.HARBOR; the full attribute set is HARBOR_THEME.
config.set_theme(THEME.HARBOR)
show_swatches()
signature(pair=("#1F4E79", "#D08C3A")).show()
#1F4E79#D08C3A#6FA3D3#EFC98C#8C6D5A#1A1A1ACividisCividisRdBuHelveticaColour-blindness, worst pair ĪE: deutan 16.1 Ā· protan 13.8 Ā· tritan 15.3 Ā· normal 15.6 Ā· greyscale gap 0 Ā pass
Dark¶
Azure, amber, mint, rose, violet and a near-white, each lifted clear of the page, on a near-black figure with the plotting area a step lighter. Every furniture colour ā spines, ticks, fonts, grid, legend frame, value labels, annotation boxes, heatmap frame and separators ā carries a light counterpart, so the theme is complete without a single override. The value scale is Viridis, which reads dark to light and so rises off the panel. A heatmap cell label still follows its own cell, so a light cell keeps dark text.
Selected with THEME.DARK; the full attribute set is DARK_THEME.
config.set_theme(THEME.DARK)
show_swatches()
signature(pair=("#63A6DE", "#DC5470")).show()
#63A6DE#CFA23A#4FE49B#DC5470#A35CE8#E6E9F2['#007094', '#009C95', '#00BE7D', '#98D84A', '#FDE333']ViridiscoolwarmHelveticaColour-blindness, worst pair ĪE: deutan 11.0 Ā· protan 11.6 Ā· tritan 13.1 Ā· normal 19.5 Ā· greyscale gap 1 Ā pass
Print and black-and-white¶
Themes that survive a greyscale printer or photocopier: greys with pattern cycles, navy ink over lightness-stepped blues and greens, hatches over muted print tones, and four whose colours stay apart for colour-blind readers and carry dashes, markers or hatches for the greyscale print.
Greyscale¶
Five slate greys 0.16 apart in lightness, with hatch, dash and marker cycles so a sixth series still differs on paper; the same open spines and muted grid treatment.
Selected with THEME.GREYSCALE; the full attribute set is GREYSCALE_THEME.
config.set_theme(THEME.GREYSCALE)
show_swatches()
signature(pair=("#1A232B", "#9EA9B4")).show()
#1A232B#424B55#6F7983#9EA9B4#D1DCE8GreysGreysRdBuHelveticaColour-blindness, worst pair ĪE: deutan 15.7 Ā· protan 15.7 Ā· tritan 15.8 Ā· normal 15.7 Ā· greyscale gap 16 Ā pass
config.set_theme(THEME.INK)
show_swatches()
signature(pair=("#1E2E85", "#299DC1")).show()
#1E2E85#EAF7B1#2165AB#85CFBA#299DC1BluesYlGnBuPuOrHelveticaColour-blindness, worst pair ĪE: deutan 13.8 Ā· protan 14.2 Ā· tritan 13.7 Ā· normal 15.7 Ā· greyscale gap 15 Ā pass
Hatch¶
Black edges, light grid, and a six-entry hatch cycle applied per bar series, so grouped bars stay distinguishable in black-and-white print; the green sits deep so it stays apart from rust for deutan readers.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.Rust, traits=[TRAIT.HATCHED, TRAIT.OUTLINED]) with the YlOrBr value scale, a light grid and the ink font stack. Selected with THEME.HATCH; the full attribute set is HATCH_THEME.
config.set_theme(THEME.HATCH)
show_swatches()
signature(pair=("#B5563A", "#5A6F86")).show()
#B5563A#5A6F86#EBBC63#2C4A34#9F9A8D#966AD5YlOrBrYlOrBrRdBuHelveticaColour-blindness, worst pair ĪE: deutan 12.0 Ā· protan 11.1 Ā· tritan 8.5 Ā· normal 15.9 Ā· greyscale gap 3 Ā pass
Muted¶
Indigo, cyan, sand, rose and wine from Paul Tol's muted scheme, every pair distinct for deutan, protan and tritan readers. Lines also differ by dash and scatter points by marker, bars carry black edges and the grid is dotted, so a figure survives a greyscale print.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.TolMuted, traits=[TRAIT.PATTERNED, TRAIT.EDGED]) with the YlOrBr value scale and a light grid. Selected with THEME.MUTED; the full attribute set is MUTED_THEME.
config.set_theme(THEME.MUTED)
show_swatches()
signature(pair=("#332288", "#CC6677")).show()
#332288#88CCEE#DDCC77#CC6677#882255YlOrBrYlOrBrRdBuHelveticaColour-blindness, worst pair ĪE: deutan 17.3 Ā· protan 10.5 Ā· tritan 16.0 Ā· normal 17.8 Ā· greyscale gap 3 Ā pass
Contrast¶
Navy, straw, dusty rose, charcoal and grey, each a clear lightness step from the next, so a photocopy still tells the series apart; bars take a hatch cycle and black edges, lines a dash cycle, scatter points a marker cycle.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.Contrast, traits=[TRAIT.PATTERNED, TRAIT.HATCHED]) with the Cividis value scale. Selected with THEME.CONTRAST; the full attribute set is CONTRAST_THEME.
config.set_theme(THEME.CONTRAST)
show_swatches()
signature(pair=("#1F4E79", "#B45C6A")).show()
#1F4E79#D4B24C#B45C6A#2B2B2B#9A9A9ACividisCividisRdBuHelveticaColour-blindness, worst pair ĪE: deutan 10.1 Ā· protan 12.6 Ā· tritan 12.1 Ā· normal 15.3 Ā· greyscale gap 9 Ā pass
Muted hatch¶
The five muted colours of MUTED under the hatch cycle of CONTRAST, so bars survive a greyscale print by pattern as well as colour. The value scale is BuPu, the family of indigo and wine, instead of YlOrBr.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.TolMuted, traits=[TRAIT.PATTERNED, TRAIT.HATCHED]) with the BuPu value scale and a light grid. Selected with THEME.MUTEDHATCH; the full attribute set is MUTEDHATCH_THEME.
config.set_theme(THEME.MUTEDHATCH)
show_swatches()
signature(pair=("#332288", "#CC6677")).show()
#332288#88CCEE#DDCC77#CC6677#882255BuPuBuPuBrBGHelveticaColour-blindness, worst pair ĪE: deutan 17.3 Ā· protan 10.5 Ā· tritan 16.0 Ā· normal 17.8 Ā· greyscale gap 3 Ā pass
Slate hatch¶
The HATCH theme without rust: slate blue, sand, wine, green, orchid and sky blue under black edges, hatches and a light grid, every pair distinct for deutan and protan readers. The value scale is PuBu.
Built as derive_theme(THEME.DEFAULT, lead=COLORS.Slate, traits=[TRAIT.HATCHED, TRAIT.OUTLINED]) with the PuBu value scale and the hatch theme's grid and fonts. Selected with THEME.SLATEHATCH; the full attribute set is SLATEHATCH_THEME.
config.set_theme(THEME.SLATEHATCH)
show_swatches()
signature(pair=("#4F6D8F", "#743538")).show()
#4F6D8F#D4D389#743538#67A652#C06AC9#8EB2D2PuBuPuBuBrBGHelveticaColour-blindness, worst pair ĪE: deutan 9.6 Ā· protan 9.9 Ā· tritan 8.6 Ā· normal 17.7 Ā· greyscale gap 1 Ā pass
Illustrative¶
Hand-drawn looks for explainers, blog posts and talks, where a chart should read as a drawing rather than a measurement.
Sketch¶
Hand-drawn: wobbled paths, series lines cut out by a white halo, thick spines and lines, no grid, and the Comic Neue font, downloaded on first use, so the look is the same on every machine. The wobble and halo are theme attributes applied at render time, so nothing changes in matplotlib's global settings; the halo sits under line, radial and regression lines only, and a chart's style can set plot_sketch_halo_width to 0 where many lines overlap. The green is greyed towards sage so it stays apart from vermilion for deutan readers.
Selected with THEME.SKETCH; the full attribute set is SKETCH_THEME.
config.set_theme(THEME.SKETCH)
show_swatches()
signature(pair=("#3F84A3", "#E4572E")).show()
#E4572E#3F84A3#F4BA2D#784AAD#90B376YlOrRdYlOrRdRdBuComic NeueColour-blindness, worst pair ĪE: deutan 9.5 Ā· protan 9.9 Ā· tritan 14.7 Ā· normal 15.2 Ā· greyscale gap 6 Ā pass
Quill¶
Black ink on white paper, as a quill and an etching needle would draw it. There is one ink only, so series differ by line style, marker and etching, never by color. Series lines are broad-nib pen strokes whose width follows the pen's direction. Bars, areas and bodies are etched by hand instead of tiled with a hatch, with a faint ink wash under the bars and bodies. A value scale (heatmap, calendar, hexbin, filled contour) reads as steps of etch density; where a chart asks for a colorbar, a legend of the steps takes its place. Text is set in the IM Fell English font, downloaded on first use, titles in its italic. Like the sketch look, every effect is a theme attribute applied at render time, so nothing changes in matplotlib's global settings.
Selected with THEME.QUILL; the full attribute set is QUILL_THEME.
config.set_theme(THEME.QUILL)
show_swatches()
signature(pair=("#1A120A", "#1A120A")).show()
#1A120AGreysGreysRdBuIM FELL EnglishColour-blindness: one ink, series differ by pattern, not colour.
Applying a theme replaces the whole global configuration, so remember to call
config.set_theme(...) (or config.reset()) before building the charts
it should style. See the themes how-to for customizing themes
attribute by attribute.
config.reset()