Styles and Presets¶
dartwork-mpl ships with 7 curated presets that configure fonts, line
weights, spine visibility, and color scheme in one call — plus Korean (-kr)
variants for each, giving 14 presets total.
Quick start¶
import dartwork_mpl as dm
dm.style.use("scientific") # papers & journals
dm.style.use("report") # reports & dashboards
dm.style.use("minimal") # Tufte-style, data-ink focus
dm.style.use("presentation") # slides
dm.style.use("poster") # conference posters
dm.style.use("web") # web pages & documentation
dm.style.use("dark") # dark backgrounds (Jupyter, dark slides)
dm.style.use("scientific-kr") # any preset + Korean fonts
Interactive comparison¶
Toggle between presets below to see how font sizes, spines, line weights, tick marks, and colors change on the same chart:
Preset details¶
All presets share a common base layer that sets thin lines (0.5 pt),
no grid, Roboto font family, and 300 font weight. Each preset then
overrides specific values on top.
Font size comparison¶
rcParam |
scientific |
report |
minimal |
presentation |
poster |
web |
dark |
|---|---|---|---|---|---|---|---|
|
7.5 |
8.0 |
7.5 |
10.5 |
12.0 |
11.0 |
11.0 |
|
8.5 |
9.0 |
8.5 |
11.5 |
14.0 |
13.0 |
13.0 |
|
7.5 |
8.0 |
7.5 |
10.5 |
12.0 |
11.0 |
11.0 |
|
7.0 |
7.0 |
7.0 |
10.0 |
11.0 |
10.0 |
10.0 |
|
5.5 |
6.0 |
5.5 |
8.5 |
9.0 |
8.5 |
8.5 |
All sizes in pt. Every preset uses font.weight: 300 and
axes.labelweight: 400 uniformly.
Axes decoration comparison¶
Property |
scientific |
report |
minimal |
presentation |
poster |
web |
dark |
|---|---|---|---|---|---|---|---|
Top/right spines |
✓ |
✗ |
all off |
✓ |
✗ |
✗ |
✗ |
Tick marks |
✓ |
✓ |
none |
✓ |
large |
✓ |
✓ |
Lines |
0.5 pt |
0.5 pt |
0.5 pt |
0.5 pt |
1.5 pt |
0.5 pt |
0.5 pt |
|
0.3 |
0.3 |
0 |
0.3 |
0.5 |
0.4 |
0.3 |
Background |
white |
white |
white |
white |
white |
white |
|
scientific — papers & journals¶
The default preset. Compact font sizes designed for single-column journal figures at 3.5″ width. All four spines are visible to match traditional academic conventions.
dm.style.use("scientific")
fig, ax = plt.subplots(figsize=(dm.cm2in(9), dm.cm2in(6)))
Best for: LaTeX papers, IEEE/Elsevier submissions, technical notes.
report — reports & dashboards¶
Slightly larger fonts than scientific, with top and right spines hidden
for a cleaner, less boxy feel. Ideal for PDF reports, internal memos, or
dashboard exports.
dm.style.use("report")
Best for: Business reports, data dashboards, executive summaries.
minimal — Tufte-style data focus¶
Inspired by Edward Tufte’s principle of maximizing the data-ink ratio.
Removes all spines, tick marks, and grid lines — only the data and labels
remain. Uses compact scientific font sizes.
dm.style.use("minimal")
Best for: Infographics, editorial charts, minimalist data storytelling.
presentation — slides¶
Large fonts (10.5 pt base) so text remains readable when projected. All four spines are kept to give charts clear boundaries on busy slide backgrounds.
dm.style.use("presentation")
Best for: PowerPoint/Keynote slides, screen-shared figures, talks.
poster — conference posters¶
The largest font scale (12 pt base, 14 pt titles) with thicker lines (1.5 pt) and larger tick marks (4 pt). Top/right spines hidden for a modern look. Designed to be readable from 1–2 meters away.
dm.style.use("poster")
fig, ax = plt.subplots(figsize=(8, 6)) # poster-sized panel
Best for: A0/A1 conference posters, large wall displays, signage.
web — web & documentation¶
Tuned for on-screen readability at typical browser zoom levels. Fonts are
larger than scientific (11 pt) but smaller than poster. Top/right spines
hidden. This is the preset used for the dartwork-mpl docs themselves.
dm.style.use("web")
Best for: Sphinx/MkDocs documentation, blog posts, Jupyter notebooks shared as HTML, README figures.
dark — dark mode¶
Inverts the color scheme for dark backgrounds (#1e1e1e). Uses web font
sizes (11 pt) for screen readability, with top/right spines hidden. Spine
and tick colors are set to subtle grays so they don’t overpower the data.
dm.style.use("dark")
Best for: Dark Jupyter themes, dark-mode slides, dark-themed web pages.
Korean variants (-kr)¶
Append -kr to any preset name to swap the font family to Korean-capable
typefaces:
Layer |
Primary font fallback chain |
|---|---|
English |
Roboto → Lato → Inter → Open Sans → Arial |
Korean |
Paperlogy → Noto Sans CJK KR → Pretendard → Gothic A1 |
dm.style.use("report-kr") # report sizing + Korean fonts
dm.style.use("dark-kr") # dark theme + Korean fonts
All 7 base presets have a -kr variant: scientific-kr, report-kr,
minimal-kr, presentation-kr, poster-kr, web-kr, dark-kr.
How presets work¶
Presets are built by stacking style layers — each subsequent layer overrides only the values it cares about:
scientific = base → font-scientific
report = base → font-report
minimal = base → font-minimal → theme-minimal
dark = base → font-web → theme-dark
dark-kr = base → font-web → theme-dark → lang-kr
The base layer provides shared defaults (line widths, tick sizes, Roboto
font family). Font layers (font-*) configure sizes and spine visibility.
Theme layers (theme-*) override colors or chrome. lang-kr swaps font
families. You don’t need to manage layers manually — dm.style.use() handles
the stacking.
Advanced: custom stacking¶
For use cases not covered by presets, you can compose layers directly:
# Dark report — report fonts + dark colors
dm.style.stack(["base", "font-report", "theme-dark"])
# Minimal with large fonts — web sizes + no chrome
dm.style.stack(["base", "font-web", "theme-minimal"])
# List all available style layers
dm.list_styles()
# → ['base', 'font-scientific', 'font-report', 'font-minimal',
# 'font-presentation', 'font-poster', 'font-web', 'theme-minimal',
# 'theme-dark', 'lang-kr', 'spine-no', 'spine-yes', ...]
# Inspect any single layer
dm.load_style_dict("font-web")
# → {'font.size': 11.0, 'axes.titlesize': 13.0, ...}
Standalone style layers¶
Individual layers for use with style.stack:
Layer |
Purpose |
|---|---|
|
Shared defaults (line widths, Roboto, tick sizes) |
|
Font sizes + spine visibility for each preset |
|
Dark color scheme (backgrounds, text, tick colors) |
|
Removes all spines, ticks, and grid lines |
|
Korean font family override |
|
Hides top + right spines |
|
Shows all four spines |
Legacy note:
dmplanddmpl_lightpredate the current preset system and are retained for backwards compatibility. For new projects, use a named preset instead.
See also¶
API › Style Management for all helper functions and arguments
Fonts for the complete list of bundled typefaces