House style "ink and crimson" for figures, pages and reports, as an installable Python package. It bundles the fonts (Atkinson Hyperlegible and Barlow Condensed, both under the SIL Open Font License), a matplotlib style that seaborn inherits, a matching plotly template, and a CSS file for pages and artifacts. The palette, type and shape language are listed below.
Palette ink #111111, dark grey #3a3a3c, grey #8a8a8e, light grey #cfcfd2, off-white #f1f1f2, crimson #a4161a, deep red #6a040f, navy #1d3557, orange #e07a1f. Categorical order is ink, grey, crimson, navy, dark grey, deep red, with orange for one or two highlights only. Body text and numbers are Atkinson Hyperlegible, headings and panel letters Barlow Condensed 600. Square corners, flat colour, thin rules, no rounded shapes, shadows or gradients. The style fixes colours, fonts and shapes only, layouts are free.
With uv, pinned to a tag.
uv add "visuals-data @ git+ssh://git@github.com/frederickzyb/visuals-data.git@v1.0.2"
With pip.
pip install "visuals-data @ git+ssh://git@github.com/frederickzyb/visuals-data.git@v1.0.2"
import visuals_data as vd
vd.apply_style() # matplotlib rcParams, bundled fonts, plotly default template
vd.CATEGORICAL # [ink, grey, crimson, navy, dark grey, deep red]
vd.UP, vd.DOWN, vd.NONSIG # crimson, navy, light grey
vd.panel_label(ax, "a") # lowercase panel letter, Barlow Condensed 600, 8 pt
vd.save_figure(fig, "results/figures/fig1", width="double") # fig1.png at 300 dpi and fig1.svg, 183 mm wide before trimming white margins
vd.css_path() # path to style.css for pages and reportsSeaborn picks the style up from matplotlib, so call apply_style() once before plotting. Plotly figures use the template named ink_crimson, which apply_style() sets as the default. Plotly is for interactive pages, not journal figures, and matplotlib is the path for anything that gets exported. Plotly renders in a browser, so the fonts must be installed on the viewing machine or loaded through the CSS file, and a static export with kaleido only picks them up when they are installed system wide. The TTF files are in vd.fonts_dir().
For pages, link style.css and use the vd- classes. Every component is shown in src/visuals_data/html/example.html, and summary_sheet.html in the same folder is a complete one-page summary.
examples/make_example_figure.py produces the figure below.
Fig. 1 | Heat shock induces chaperone genes and represses matrix genes. a, Volcano plot of 18,422 simulated genes. Up in crimson, down in navy, non-significant in light grey. Thresholds are adjusted p below 0.05 and absolute log2 fold change above 1. b, Genes per enriched pathway, the top pathway in crimson.
import matplotlib.pyplot as plt
import visuals_data as vd
vd.apply_style()
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(7.2, 2.6))
ax1.scatter(lfc, neglog_p, s=3, c=colour, linewidths=0)
ax1.set_xlabel("log2 fold change")
ax1.set_ylabel("-log10 adjusted p")
vd.panel_label(ax1, "a")
ax2.barh(pathways, counts, color=[vd.CRIMSON] + [vd.INK] * 4)
ax2.set_xlabel("genes in pathway")
vd.panel_label(ax2, "b", dx=-68)
fig.tight_layout()
vd.save_figure(fig, "fig1", width="double")uv sync --group dev
uv run pytest
uv run python examples/make_example_figure.py
Code is MIT. Fonts are redistributed under the SIL Open Font License, see src/visuals_data/fonts/.
