polars.Expr.meta.show_graph#

Expr.meta.show_graph(
*,
show: bool = True,
output_path: str | Path | None = None,
raw_output: bool = False,
figsize: tuple[float, float] = (16.0, 12.0),
) str | None[source]#

Format the expression as a Graphviz graph.

Note that Graphviz must be installed to render the visualization (if not already present, you can download it here: https://graphviz.org/download).

Parameters:
show

Show the figure.

output_path

Write the figure to disk.

raw_output

Return dot syntax. This cannot be combined with show and/or output_path.

figsize

Passed to matplotlib if show == True.

Examples

>>> e = (pl.col("foo") * pl.col("bar")).sum().over(pl.col("ham")) / 2
>>> e.meta.show_graph()