ontometer_corpus.paper.figstyle¶
The look of every research figure: type, sizes, colour roles and small helpers.
Shared by every figure module, so a registry or a cluster keeps its colour everywhere.
Type matches the papers' body text: Latin Modern Roman with Computer Modern
mathtext, 7 pt labels and 6 pt ticks at true LNCS widths. Matplotlib can embed
only TrueType outlines cleanly in PDF, so the system's Latin Modern OpenType
files are converted once into the user cache directory (CACHE_DIR) (a private, renamed
build; DejaVu Serif when Latin Modern is not installed). Glyphs Latin Modern
lacks fall back to DejaVu Serif per glyph.
Colour follows the GrowGraph brand: ink #293241, blue #224777 and orange
#E67E22. The blue enters the categorical palette one step lighter
(#2a5f9e), because the brand blue is too dark and too grey to carry
identity as a fill; it stays as the dark end of the sequential ramp.
Colour has four roles, never mixed:
registry
categorical, by registry size, the first seven registries in palette
order and the rest folded into one neutral "other"; in a scatter (every
pair of colours on screen together) only the first three keep a hue. The
two largest closed communities, LOV and OBO, take the brand blue and
orange.
status
outcome states (fetch failed, parse failed, skipped), only where the
figure is about outcomes, always with a legend label.
cluster
a four-hue set that separates every pair, for k-means clusters.
kind
any other small categorical set (reuse kinds, fitted distributions).
Reference and median lines are muted ink; text on a filled mark takes the ink
that contrasts with the fill (:func:ink_on).
Attributes¶
FULL = 4.8
module-attribute
¶
HALF = 2.35
module-attribute
¶
CATEGORICAL_PALETTE = ['#2a5f9e', '#1baf7a', '#E67E22', '#6250d6', '#e87ba4', '#008300', '#eda100', '#e34948']
module-attribute
¶
REGISTRY_SLOTS = 7
module-attribute
¶
SCATTER_SLOTS = 3
module-attribute
¶
OTHER = 'other registries'
module-attribute
¶
CLUSTER_PALETTE = ['#2a5f9e', '#eda100', '#008300', '#e87ba4']
module-attribute
¶
KIND_PALETTE = CATEGORICAL_PALETTE[:3]
module-attribute
¶
BRAND_BLUE = '#224777'
module-attribute
¶
BRAND_ORANGE = '#E67E22'
module-attribute
¶
SEQUENTIAL_CMAP = LinearSegmentedColormap.from_list('ontometer_seq', ['#f4f6fa', BRAND_BLUE])
module-attribute
¶
DIVERGING_CMAP = LinearSegmentedColormap.from_list('ontometer_div', ['#2a5f9e', '#f2f1ec', '#9a4c0c'])
module-attribute
¶
STATUS_GOOD = '#0ca30c'
module-attribute
¶
STATUS_WARNING = '#fab219'
module-attribute
¶
STATUS_SERIOUS = '#ec835a'
module-attribute
¶
STATUS_CRITICAL = '#d03b3b'
module-attribute
¶
INK = '#293241'
module-attribute
¶
TEXT_MUTED = '#5b6475'
module-attribute
¶
NEUTRAL = '#c3c7cf'
module-attribute
¶
NEUTRAL_LIGHT = '#e6e8ec'
module-attribute
¶
SURFACE = '#ffffff'
module-attribute
¶
CACHE_DIR = Path(os.environ.get('XDG_CACHE_HOME') or Path.home() / '.cache') / 'ontometer-corpus'
module-attribute
¶
FONT_CACHE = CACHE_DIR / 'fonts'
module-attribute
¶
TEXT_FAMILY = 'OntoMeter LM Roman'
module-attribute
¶
Functions:¶
style()
¶
Draw off-screen with the rcParams every paper figure uses (scripts, not notebooks).
Source code in ontometer_corpus/paper/figstyle.py
registry_groups(order, slots=REGISTRY_SLOTS)
¶
Registry -> the group it is drawn as: itself for the first slots, else OTHER.
Source code in ontometer_corpus/paper/figstyle.py
registry_colors(order, slots=REGISTRY_SLOTS)
¶
Group -> colour, for the groups :func:registry_groups makes (OTHER neutral).
Source code in ontometer_corpus/paper/figstyle.py
cluster_color(c)
¶
tint(color, amount)
¶
color mixed toward the surface: 0 keeps the colour, 1 is the surface.
Source code in ontometer_corpus/paper/figstyle.py
ink_on(fill)
¶
White or dark ink, whichever contrasts more with fill (WCAG contrast ratio).
Source code in ontometer_corpus/paper/figstyle.py
panel(ax, letter, title)
¶
A panel title, left-aligned, with its letter in bold.
reference_line(ax, value, axis='x', **kwargs)
¶
A dotted muted line marking a median or a threshold.
Source code in ontometer_corpus/paper/figstyle.py
save(fig, out, name)
¶
<name>.pdf (no creation date, so reruns are byte-stable) and a 300 dpi PNG.