aegean.viz¶
viz ¶
One-line visualization helpers (the [viz] extra: matplotlib, imported lazily).
Convenience plots over the corpus model and the analysis layer — each function
draws one publication-ready-enough figure and returns the matplotlib Axes
(pass ax= to compose subplots; call .figure.savefig(...) to write a
file). These are conveniences, not a plotting framework: for anything bespoke,
take the numbers from aegean.analysis and plot them yourself.
import aegean stays dependency-free — matplotlib is imported only inside
the plotting calls and a missing install raises a clear pointer to
pip install 'pyaegean[viz]'. From the shell: aegean plot ….
plot_sign_frequencies ¶
Horizontal frequency bars — the aegean stats table as a figure.
kind="signs" (default) counts individual signs; kind="words" whole
words. Most frequent at the top.
plot_dispersion ¶
plot_dispersion(corpus: Any, *, kind: str = 'words', min_frequency: int = 2, annotate: int = 10, ax: Any = None) -> Any
Frequency (log x) against Gries' normalized DP (y).
The diagnostic read: bottom-right = frequent corpus-wide vocabulary;
top-right = frequent but concentrated items (formulaic or site/genre-bound
— on Aegean material usually the interesting quadrant). The annotate
most frequent items are labeled.
plot_keyness ¶
plot_keyness(target: Any, reference: Any, *, kind: str = 'words', top: int = 15, min_target: int = 2, ax: Any = None) -> Any
Diverging bars of the top-G² key items: log-ratio effect size,
right = overused in the target, left = underused. Bar labels carry G².
plot_collocation_network ¶
plot_collocation_network(corpus: Any, word: str | None = None, *, max_nodes: int = 24, min_count: int = 2, ax: Any = None) -> Any
A document-co-occurrence network of multi-sign words (circular layout).
Edges join words attested together in min_count+ documents; width and
opacity scale with the count. word restricts to that word's ego
network. Exploratory on undeciphered material: an edge is shared
context, not an asserted phrase or meaning.
plot_scansion ¶
A scansion grid for one verse line: syllables in metrical position, long (—) and short (⏑) marks, foot boundaries, and the caesura (‖).
line is Greek text (scanned via greek.scan_line) or an existing
LineScansion. Raises ScansionError if the text does not fit the
meter (synizesis is declined, never inferred).
plot_balance ¶
Accounting reconciliation at a glance: each checked total (KU-RO /
TO-SO) as computed sum (x) vs stated total (y). Points on the diagonal
balance; red points do not — the discrepancies worth a closer look. The
reconciliation inherits the heuristics of balance_check (section
boundaries are inferred), so treat outliers as leads, not verdicts.