CompartmentModel.diagram

compartment_model.CompartmentModel.diagram(file=None, figsize=None)

Render a diagram of this IPM, either by showing it with matplotlib (default) or by saving it to file as a png image.

Parameters

file: str | Path = None

Provide a file path to save a png image of the diagram to this path. If file is None, we will instead use matplotlib to show the diagram.

figsize: tuple[float, float] = None

The matplotlib figure size to use when displaying the diagram. Only used if file is not provided.