{% from 'thumb.html' import preview with context %}

Scientific figures in Python, laid out in millimetres.

Inklet places plots, diagrams, images and 3D scenes on a page with physical dimensions. It measures labels, ticks and legends before fitting the data, then writes SVG, PDF and PNG from the same geometry.

pip install inklet

Requires Python 3.11 or later. See installation options for rendering extras.

{{ preview('assets/scientific/olfactory-detail.png', '(max-width: 1023px) 100vw, 1180px', 'alt="Detail of an Inklet figure: fly-brain anatomy, neuron projection routes, local arbors and a weighted receptor-to-target network" width="1920" height="928" fetchpriority="high"') }}
Detail of a fly-brain plate built with Inklet: anatomy renders, projection routes, local arbors and a weighted connectivity network. Full figure and source

A full journal page from one script

Thirteen panels on a 183 mm page with the scientific.cell preset: 6 pt text, 0.25 pt hairlines and legends placed in empty data space. Each panel is a plot or diagram in a 12-column document.

  1. a Circuit diagram with routed links
  2. b, j Stacked and diverging bars with value labels
  3. c, g Dumbbells across 7 and 36 categories
  4. d Scatter with labelled points
  5. e, l Heatmap with zoom inset, correlation matrix
  6. f, k Cumulative distributions, log–log counts
  7. h, i, m Radar, donut and violins
{{ preview('gallery/dense-figure.png', '(max-width: 1100px) 100vw, 640px', 'alt="A thirteen-panel figure page with a circuit diagram, bars, dumbbells, a labelled scatter, heatmaps, cumulative distributions, a dot plot, radar, donut, diverging bars, a log-log plot, a correlation matrix and violins" width="2076" height="2019" loading="lazy"') }}
Output of examples/dense_figure.py. All data are simulated.

Besides lines, bars, histograms and heatmaps, each of these is one method on a plot.

{% for title in config.extra.home_plots %}{% for entry in docs_plots if entry.title == title %} {{ entry.title }}{%- set own = entry.methods|reject('in', ['Panel.scatter', 'Panel.matrix', 'PolarPanel.pie', 'PolarPanel.radar_grid'])|list -%}{{ (own or entry.methods)|first }}{% endfor %}{% endfor %}

From script to page

This script builds the two-panel figure from the first figure tutorial. The double-column preset fixes the page width at 183 mm, and Inklet sizes each plot region around its measured labels.

two_panels.py
{{ home_example }}
Output of the script: panel a shows a signal line over elapsed time, panel b shows bars for control and treatment
Output: two-panels.svg, 183 × 68 mm. Open the SVG or the PDF.
{% for id in ['biology-panels', 'complex-scene', 'wave-packets', 'scientific-blender', 'label-intensities', 'process'] %}{% for entry in docs_gallery if entry.id == id %} {{ preview(entry.image, '(max-width: 640px) 50vw, 380px', 'alt="" loading="lazy" decoding="async" width="640" height="480"') }}{{ entry.title }}{{ entry.category }}{% endfor %}{% endfor %}

Find your way around

Each section starts with an overview page of examples.

{{ page.content }}