magali.plot_bounding_boxes

magali.plot_bounding_boxes#

magali.plot_bounding_boxes(bounding_boxes, ax=None, edgecolor='k', linewidth=2, **kwargs)[source]#

Plot bounding boxes on a matplotlib Axes.

Used to visualize the bounding boxes of detected anomalies, such as those produced by magali._detection.detect_anomalies.

Parameters:
bounding_boxeslist of list of float

List of bounding boxes in data coordinates. Each bounding box is a list or array in the format [x_min, x_max, y_min, y_max].

axmatplotlib.axes.Axes, optional

The matplotlib Axes on which to plot the bounding boxes. If None, uses the current Axes.

edgecolorstr or tuple, default=”k”

Color of the bounding box edges.

linewidthfloat, default=2

Width of the bounding box edges.

**kwargsdict, optional

Additional keyword arguments passed to matplotlib.patches.Rectangle, such as linestyle or alpha.

Returns:
axmatplotlib.axes.Axes

The matplotlib Axes object with the plotted bounding boxes.