Repository navigation
Inklet 4.9.0
Found recreating ten figures from six landmark open-access Nature papers
(JWST WASP-39b, ATLAS Higgs, KATRIN, human height GWAS, brain-wide
association studies, WHO excess mortality), now in examples/published/
with a faithful and an improved version of each.
Added
i.preset(..., axes='box'): the journal frame of physics and astronomy
figures.Panel.axes()closes the plot with unlabelled top and right
axes, ticks point inward on all four sides with minor ticks between
them, the frame, ticks and labels are black at 0.21 mm or more, and
default data lines are as heavy as the frame. A heatmap gets the frame
without ticks over its cells.axes='frame'closes the plot the same way
but ticks only the labelled bottom and left axes, leaving the top and right
edges plain, as JWST's figures do. The default,axes='open', is unchanged.Panel.contour(x, y, z, levels=... | hdr=(0.683, 0.954))draws contours
of a gridded field;hdr=gives highest-density regions enclosing those
fractions of the total.inklet.plot.mass_levelstakes a plain grid.Panel.hist(counts, bins=edges, prebinned=True)draws counts that are
already binned, in either orientation and withdensity=True.Document.label(x=..., y=...)writes one axis title across a grid of
cells, centred on their plot areas.Document.letters({'cell': 'a', ...})sets panel letters by cell name, so
a figure can skip letters (a, b, e, f) or match them to cells; unnamed
cells take the next free letters.Panel.key_diagram()returns a panel's key as a diagram for an empty grid
cell.hline,vline,hspanandvspantakename=and appear in the key
with their own paint.errorbars(..., floor='arrow' | 'none'): on a log axis, a whisker whose
bound is zero or below runs to the axis floor, by default with an open
arrowhead, instead of raising.errorbars(stroke=[...])andannotate(color=...): one colour per point,
and one colour for a callout's words and leader.figure.report(expect={'SERIES_FLATTENED'})(andlint(expect=...))
acknowledges a diagnostic that is intended; it is listed apart and does
not count as a problem. An unknown code raises.- Lint codes:
DATA_CLIPPED(info, points hidden byclip=True),
MARKER_CUT(warning, a square or path marker cut at the plot edge),
PLOT_WIDTH_OVERRIDDEN(warning, a plot drawn over 15% narrower than its
authored width because it shares its rows),AXIS_TITLE_OVERHANG
(warning, a y title that runs into another cell or off the page) and
BAR_WIDTH_OUT_OF_SCALE(warning, bars wider than their axis, with the
width's units). - The agent guide says to set variables in italic (
//m//_{ν}^{2} (eV^{2}))
and to plot dates on a calendar axis rather than as decimal years;
text()documentsalign=,anchor=andoffset=exactly.
Changed
scientific.naturesets tick labels and keys at 7 pt, the top of Nature's
5–7 pt range and the size of Nature's own typeset figures; at 6 pt they read
a size smaller than the published ones. Passfont_size=i.pt(6)to a crowded
key.- A second
legend()call on a panel replaces the first key's options, as
the guide said, instead of adding a second key. - A band no longer puts its series first in the key when it is drawn before
the series' line. Band swatches are the band's colour at its opacity. FONT_SUBSTITUTEDis information, not a warning, when the substitute is
metrically identical to the expected font (Liberation Sans or Arimo for
Arial and Helvetica, Liberation Serif or Tinos for Times, Liberation Mono
or Cousine for Courier New), and it is reported once per font pair.INCONSISTENT_STROKEcounts only stroke widths the author set (axes,
ticks, keys, colour bars and error-bar caps are the library's), and names
each weight's role ("errorbars 'Data'", "axis spine").- Thinned explicit ticks are reported once, by
TICKS_DROPPED; the Python
UserWarningis gone. Document.add()withcolumn=but norow=raises when that column is
free in the last row, instead of starting a new row and drawing the cells
down a diagonal.- A cell name with a space is refused at
add()with the reason.
Fixed
- A y-axis title longer than its plot is tall no longer makes the plot
taller: stacked strips keep one scale. The title overhangs, as
matplotlib's does, and lint reports it only if it runs into something. - An authored
plot_specwidth is kept when its row has room; when it does
not, every authored width gives way only as far as it must, instead of
all falling back to equal column shares. annotate(color=)failed at compile with aTypeError;
errorbars(stroke=[...])crashed the SVG writer; thinning explicit tick
labels crashed compile with anAttributeError.- A callout whose point lies outside the plot range stays inside the plot
when a clear spot exists. - Lint no longer counts blank or zero matrix cells as marks, so a label over
an empty bin is not an overlap. - An inset whose text was shrunk by
inset(width=...)is reported with
width=Noneas the fix, not a bigger font. legend(size=...)suggestsfont_size=; a top key wider than its cell is
named as the cause of theLayoutError.- A top or bottom key even slightly wider than its cell raised "plot
furniture did not settle after 24 measurement passes"; the error now names
the key, its width and the cell's, and the fix. - Log axes with
minor=Truedraw the 2–9 subdivisions when the sparser
mantissas are all labelled.