Matplotlib#
- class discopy.drawing.backend.Matplotlib(axis=None, figsize=None, linewidth=1, format=None)[source]#
Bases:
BackendMatplotlib drawing backend.
- dark_gid(kind)[source]#
A fresh id prefixed
dark-strokeordark-fill, tagging an element drawn black on the neutral canvas so thatDARK_MODE_STYLEturns it white on a dark page.
- draw_region_cell(left, right, facecolor)[source]#
Fill the cell between two quadratic Beziers with a single patch: down the
leftboundary, straight across the bottom, up therightboundary and straight back across the top. Antialiasing is disabled so that abutting cells of the same colour do not leave a hairline seam where the background shows through.
- draw_regions(graph, **params)[source]#
Fill the coloured 0-cell regions of the diagram, one patch per cell of
region_cells().
- draw_spiders(graph, draw_box_labels=True, **params)[source]#
Draws the spiders, grouped by shape and by whether they adapt to a dark page: black spiders lie on the neutral canvas so they turn white, coloured ones keep their colour. A transparent spider is just its label, e.g. the symbol of an
discopy.monoidal.Equation, which leaves no patch on a coloured page.