Skip to content
render_tight_svg

render_tight_svg

Mojo function 🡭

render_tight_svg

fn def render_tight_svg[C: ChartLike](plot: C) -> SvgCanvas

render_svg() cropped to the figure’s ink; render_tight()’s vector counterpart (#372).

The same three steps – measure, size, redraw – and the reason the measuring target was worth asking canvas for: an SvgCanvas has no pixels to scan for ink, so nothing else could have answered this.

Parameters:

  • C (ChartLike)

Args:

  • plot (C): The chart to render.

Returns:

SvgCanvas: An SvgCanvas the size of the figure’s ink.

Raises:

Error: Whatever render_svg() raises.