Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a *for_layout_only* kwarg; this helper tries to use the kwarg but skips it when encountering third-party subclasses that do not support it.
(obj, *args, **kwargs)
| 1476 | |
| 1477 | |
| 1478 | def _get_tightbbox_for_layout_only(obj, *args, **kwargs): |
| 1479 | """ |
| 1480 | Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a |
| 1481 | *for_layout_only* kwarg; this helper tries to use the kwarg but skips it |
| 1482 | when encountering third-party subclasses that do not support it. |
| 1483 | """ |
| 1484 | try: |
| 1485 | return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True}) |
| 1486 | except TypeError: |
| 1487 | return obj.get_tightbbox(*args, **kwargs) |
| 1488 | |
| 1489 | |
| 1490 | class ArtistInspector: |
nothing calls this directly
no test coverage detected
searching dependent graphs…