Blobs.plot_labelbox#
- Blobs.plot_labelbox(fmt: str | None = None, label: str = '{:d}', *, position: str = 'topleft', textcolor: Any = None, labelcolor: Any = None, text_style: dict[str, Any] | None = None, **kwargs: Any) None[source][source]#
Plot a labelled bounding box of blobs using Matplotlib
- Parameters:
fmt – Matplotlib format string for the box, such as
"r--"label (str or bool, optional) – label to be displayed on the bounding box, defaults to blob id
position – place to draw the label:
"topleft"(default),"topright","bottomleft"or"bottomright"textcolor – color of the label text, defaults to black
labelcolor – label background color, defaults to the edge color of the box
text_style – Matplotlib text options for the label, such as
dict(fontsize=12, fontweight="bold"), defaults to Nonekwargs – Matplotlib patch options for the box, passed to
plot_labelbox
The label text color and background can be set by
text_style, bytextcolorandlabelcolor, or by default, and the most specific wins: seeplot_labelbox.Changed in version 2.5.0: Added
text_style, and the label background follows the edge color of the box however that was set.Plot a labelled bounding box for every blob described by this object.
By default the label is the blob id, but a custom label can be provided by setting
labelto a string with a single format field, e.g."Blob {:d}". SettinglabeltoTrueis the same as the default.By default, blobs are labeled by their blob id.
Examples
(
Source code,png,hires.png,pdf)
See also