cm
result = figure_size(mm(180), mm(120))
Input: mm(180), mm(120) · Output: result
What it is
Length units as functions, converting a scalar v (millimetres/centimetres/inches/points as named) to the figure's own coordinate space — a tenth of a millimetre, so mm(1) is 10, cm(1) is 100, inch(1) is 254, and pt(1) is ≈3.528 (25.4/72 mm per point).
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = figure_size(mm(180), mm(120)) | mm(180) —not documented yetmm(120) —not documented yet | result scalar, Num, or number | Returns a scalar Num. There is no 180mm literal — a bare number is always taken as figure units directly. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
print("mm(10)={mm(10)} cm(1)={cm(1)} inch(1)={inch(1)}") # e.g. figure_size(mm(180), mm(120))
f = fifo(2)
print("is_empty={is_empty(f)}")
push(f, 1)
push(f, 2)
print("is_full={is_full(f)}") # at capacity -- the next push would evict the oldest
mm(10)=100 cm(1)=100 inch(1)=254 is_empty=true is_full=true
from core-math
How it works
loglog/semilogx/semilogy — thin convenience wrappers: plot the series, then set whichever axes the name implies to log scale (both already-real features, just not combined into one call before now). xscale("log") / yscale("log") -- set an axis scale on its own, without plotting anything. loglog/semilogx/semilogy below can only set a scale as a side effect of drawing a series, which leaves every plot that has no series -- a contour, a heatmap, an annotated but empty panel -- with no way to ask for a log axis at all. That is what blocked the ceiling map: the whole figure is a contourf on two log axes. pt(n) / mm(n) / inch(n) -- a size in the unit people actually think in, converted to the figure units everything here measures in. A figure unit is a tenth of a millimetre, which nobody has any intuition for. Writing fontsize = 7 meaning 7 point silently asks for 0.7 mm -- about two point -- and the result is a legend that renders but cannot be read. There is no safe way to guess which was meant (6-14 is a plausible number in either unit), so the unit is spelled: legend(fontsize = pt(7)).
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.