cottax.consumers.visualization.latex.matrix module

N2 figures for a LaTeX document: render_matrix_svg set in the document’s face at the size it prints – a px of the drawing is a px of the page, so include it without a `width=` – and several set as one figure (save_rows): rows of panels, a label under each, an operation between two, and one key under them all.

Needs cairosvg.

save_rows(rows, path, *, page='full', text_pt: float = 7.0, labels=None, ops=None, legend: bool = True, columns: bool = False, gutter_em: float = 2.0, row_gap_em: float = 1.2, align: str = 'top', layout: Layout = REVTEX, formats=('pdf', 'svg'), **kw)[source]

Rows of N2 panels as one drawing, its type printing at text_pt. A panel is a graph or (graph, kwargs), kw render_matrix_svg’s for every panel and a panel’s own over it. A panel given a cell is drawn at it; the others in a row share one pitch, so the row fills page of the line (a name in PAGE or a fraction). Per row, labels names each panel under it and ops the n - 1 operations between them (an arrow, op_arrow). columns gives the names of the panels at one position across the rows one column, flush left, so the rows’ matrices start alike. legend keys every subsystem and problem type drawn, once. align (‘top’ or ‘bottom’) sets the panels of a row against its top or its bottom edge: ‘bottom’ lines a cut’s rows up with the rows it was cut from when what it adds sits above them.

Returns the paths written.

to_svg(graph, *, layout: Layout = REVTEX, text_pt: float = 7.0, **kw)[source]

render_matrix_svg in layout’s face, its type printing at text_pt, without a key (a figure draws one for all its panels). Every argument is render_matrix_svg’s.

Return type:

SvgDoc