Container for an `OffsetBox` referring to a specific position *xy*. Optionally an arrow pointing from the offsetbox to *xy* can be drawn. This is like `.Annotation`, but with `OffsetBox` instead of `.Text`.
| 1289 | |
| 1290 | |
| 1291 | class AnnotationBbox(martist.Artist, mtext._AnnotationBase): |
| 1292 | """ |
| 1293 | Container for an `OffsetBox` referring to a specific position *xy*. |
| 1294 | |
| 1295 | Optionally an arrow pointing from the offsetbox to *xy* can be drawn. |
| 1296 | |
| 1297 | This is like `.Annotation`, but with `OffsetBox` instead of `.Text`. |
| 1298 | """ |
| 1299 | |
| 1300 | zorder = 3 |
| 1301 | |
| 1302 | def __str__(self): |
| 1303 | return f"AnnotationBbox({self.xy[0]:g},{self.xy[1]:g})" |
| 1304 | |
| 1305 | @_docstring.interpd |
| 1306 | def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, *, |
| 1307 | frameon=True, pad=0.4, # FancyBboxPatch boxstyle. |
| 1308 | annotation_clip=None, |
| 1309 | box_alignment=(0.5, 0.5), |
| 1310 | bboxprops=None, |
| 1311 | arrowprops=None, |
| 1312 | fontsize=None, |
| 1313 | **kwargs): |
| 1314 | """ |
| 1315 | Parameters |
| 1316 | ---------- |
| 1317 | offsetbox : `OffsetBox` |
| 1318 | |
| 1319 | xy : (float, float) |
| 1320 | The point *(x, y)* to annotate. The coordinate system is determined |
| 1321 | by *xycoords*. |
| 1322 | |
| 1323 | xybox : (float, float), default: *xy* |
| 1324 | The position *(x, y)* to place the text at. The coordinate system |
| 1325 | is determined by *boxcoords*. |
| 1326 | |
| 1327 | xycoords : single or two-tuple of str or `.Artist` or `.Transform` or \ |
| 1328 | callable, default: 'data' |
| 1329 | The coordinate system that *xy* is given in. See the parameter |
| 1330 | *xycoords* in `.Annotation` for a detailed description. |
| 1331 | |
| 1332 | boxcoords : single or two-tuple of str or `.Artist` or `.Transform` \ |
| 1333 | or callable, default: value of *xycoords* |
| 1334 | The coordinate system that *xybox* is given in. See the parameter |
| 1335 | *textcoords* in `.Annotation` for a detailed description. |
| 1336 | |
| 1337 | frameon : bool, default: True |
| 1338 | By default, the text is surrounded by a white `.FancyBboxPatch` |
| 1339 | (accessible as the ``patch`` attribute of the `.AnnotationBbox`). |
| 1340 | If *frameon* is set to False, this patch is made invisible. |
| 1341 | |
| 1342 | annotation_clip: bool or None, default: None |
| 1343 | Whether to clip (i.e. not draw) the annotation when the annotation |
| 1344 | point *xy* is outside the Axes area. |
| 1345 | |
| 1346 | - If *True*, the annotation will be clipped when *xy* is outside |
| 1347 | the Axes. |
| 1348 | - If *False*, the annotation will always be drawn. |
no outgoing calls
searching dependent graphs…