Skip to content

igl.viz

Optional plotting helpers. Requires the [viz] extra — importing any submodule of igl.viz raises IGLDependencyError when matplotlib is missing.

igl.viz.dimension_curve.plot_dimension_curve(curve, *, ax=None, elbow=None, title=None, label=None, log_y=True)

Plot a Matryoshka dimension curve.

Parameters:

Name Type Description Default
curve DimensionCurve

{k: loss} mapping (the dimension_curve_ attribute of a fitted IGL estimator, or the return value of :func:igl.eval_dimension_curve).

required
ax Axes | None

Optional axes to draw on. Created via plt.subplots() when absent.

None
elbow int | None

If provided, draw a vertical marker line at this k.

None
title str | None

Optional axes title.

None
label str | None

Optional line label (for use with multi-curve overlays).

None
log_y bool

Use a log-scale Y axis (the elbow is usually clearer on log).

True

Returns:

Type Description
Axes

The axes the curve was drawn on.

igl.viz._matplotlib.require_matplotlib()

Raise :class:IGLDependencyError if matplotlib is not importable.