Theme Gallery¶
Each predefined theme has a card here: a strip of its color swatches with hex
codes, the sequential colormap, and the font it sets in, 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 palette, bottom spine only, light grid. |
THEME.MINIMAL | Accent violet with deep grays, no spines, flat bars. |
THEME.HARBOR | Navy and amber in lightness steps, colour-blind safe. |
| Print and black-and-white | |
THEME.GREYSCALE | Monochrome, print-friendly. |
THEME.INK | Diversified YlGnBu palette with navy ink accents. |
THEME.HATCH | Hatch cycle, black edges, dotted grid. |
THEME.MUTED | Tol's muted colours, dash and marker cycles, colour-blind safe. |
THEME.CONTRAST | Lightness-stepped colours plus hatches, print-safe. |
| 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.
The sample data and the two helpers behind every card are defined in a hidden
cell. show_swatches() reads the palette, sequential colormap and font straight
from the active config, so the strip always matches the theme as shipped.
It closes with the theme's colour-blindness scores, computed by cvd_scores() 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. GREYSCALE and QUILL separate series by
lightness and pattern rather than hue, so their scores read the colour axis
only. DEFAULT, HARBOR, MUTED and CONTRAST were built to pass this check.
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 | 1.3 | 6.4 | 5.8 | 17.8 | 0 | fail |
minimal | 4 | 17.5 | 17.2 | 15.0 | 17.5 | 13 | pass |
harbor | 6 | 16.1 | 13.8 | 15.3 | 15.6 | 0 | pass |
| Print and black-and-white | |||||||
greyscale | 6 | 4.0 | 4.2 | 4.1 | 4.1 | 4 | fail |
ink | 6 | 9.5 | 8.1 | 7.2 | 9.1 | 8 | fail |
hatch | 6 | 3.6 | 5.0 | 2.5 | 8.8 | 0 | fail |
muted | 5 | 17.3 | 10.5 | 16.0 | 17.8 | 3 | pass |
contrast | 5 | 10.1 | 12.6 | 12.1 | 15.3 | 9 | pass |
| Illustrative | |||||||
sketch | 5 | 4.8 | 7.3 | 11.5 | 14.3 | 4 | fail |
quill | 1 | one ink; series differ by pattern | ā | ||||
Screen and presentations¶
Colorful categorical palettes on light furniture, for notebooks, dashboards and slides.
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#444444BluesHelveticaColour-blindness, worst pair ĪE: deutan 10.8 Ā· protan 12.8 Ā· tritan 8.3 Ā· normal 15.7 Ā· greyscale gap 0 Ā pass
Material¶
The Google palette with 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", "#D93025")).show()
#1A73E8#D93025#F9AB00#1E8E3E#12B5CB#9334E6BluesRobotoColour-blindness, worst pair ĪE: deutan 1.3 Ā· protan 6.4 Ā· tritan 5.8 Ā· normal 17.8 Ā· greyscale gap 0 Ā fail
Minimal¶
Accent violet with deep grays, 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", "#1F2933")).show()
#7048E8#1F2933#8A97A3#C5CDD4PurplesHelveticaColour-blindness, worst pair ĪE: deutan 17.5 Ā· protan 17.2 Ā· tritan 15.0 Ā· normal 17.5 Ā· greyscale gap 13 Ā 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.
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#1A1A1ACividisHelveticaColour-blindness, worst pair ĪE: deutan 16.1 Ā· protan 13.8 Ā· tritan 15.3 Ā· normal 15.6 Ā· greyscale gap 0 Ā pass
Print and black-and-white¶
Themes that survive a greyscale printer or photocopier: one that is monochrome by design, one whose palette stays distinct on paper, one that tells series apart by pattern, and two whose colours stay apart for colour-blind readers and carry dashes, markers or hatches for the greyscale print.
Greyscale¶
Monochrome and print-friendly, with 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=("#252525", "#969696")).show()
#2C3E50#5D6D7E#85929E#ABB2B9#D5DBDB#34495EGreysHelveticaColour-blindness, worst pair ĪE: deutan 4.0 Ā· protan 4.2 Ā· tritan 4.1 Ā· normal 4.1 Ā· greyscale gap 4 Ā fail
config.set_theme(THEME.INK)
show_swatches()
signature(pair=("#0C2C84", "#41B6C4")).show()
#0C2C84#7FCDBB#1D91C0#C7E9B4#225EA8#41B6C4BluesHelveticaColour-blindness, worst pair ĪE: deutan 9.5 Ā· protan 8.1 Ā· tritan 7.2 Ā· normal 9.1 Ā· greyscale gap 8 Ā fail
Hatch¶
Black edges, dotted grid, and the hatch cycle ("", "//", "..") applied per bar series, so grouped bars stay distinguishable in black-and-white print.
Selected with THEME.HATCH; the full attribute set is HATCH_THEME.
config.set_theme(THEME.HATCH)
show_swatches()
signature(pair=("#B5563A", "#4F6D8F")).show()
#B5563A#4F6D8F#D4A64A#4E7A5A#A6A6A6#7B5EA7YlOrBrHelveticaColour-blindness, worst pair ĪE: deutan 3.6 Ā· protan 5.0 Ā· tritan 2.5 Ā· normal 8.8 Ā· greyscale gap 0 Ā fail
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.
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#882255YlOrBrHelveticaColour-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.
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#9A9A9ACividisHelveticaColour-blindness, worst pair ĪE: deutan 10.1 Ā· protan 12.6 Ā· tritan 12.1 Ā· normal 15.3 Ā· greyscale gap 9 Ā 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 bundled Comic Neue font, 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.
Selected with THEME.SKETCH; the full attribute set is SKETCH_THEME.
config.set_theme(THEME.SKETCH)
show_swatches()
signature(pair=("#2E86AB", "#E4572E")).show()
#E4572E#2E86AB#F5B700#7E5AAB#76B041YlOrRdComic NeueColour-blindness, worst pair ĪE: deutan 4.8 Ā· protan 7.3 Ā· tritan 11.5 Ā· normal 14.3 Ā· greyscale gap 4 Ā fail
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 bundled IM Fell English font, 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()
#1A120AGreysIM 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_config()) before building the charts
it should style. See the themes how-to for customizing themes
attribute by attribute.
config.reset_config()