TikZ#

class discopy.drawing.backend.TikZ(use_tikzstyles=None)[source]#

Bases: Backend

Tikz drawing backend.

static format_color(color)[source]#

Formats a color.

add_node(i, j, text=None, options=None, rounded=4)[source]#

Add a node to the tikz picture, return its unique id.

draw_regions(graph, **params)[source]#

Coloured regions are not wired up for the TikZ backend yet, even though draw_curved_polygon() is implemented above: region colours may be arbitrary matplotlib colours (e.g. hexcodes) that are not valid TikZ/xcolor names, so filling them in for real needs a colour-formatting step similar to format_color(). This is a deliberate no-op in the meantime, leaving TikZ’s output as-is.