MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / Bbox

Class Bbox

lib/matplotlib/transforms.py:692–1129  ·  view source on GitHub ↗

A mutable bounding box. Examples -------- **Create from known bounds** The default constructor takes the boundary "points" ``[[xmin, ymin], [xmax, ymax]]``. >>> Bbox([[1, 1], [3, 7]]) Bbox([[1.0, 1.0], [3.0, 7.0]]) Alternatively, a Bbox can be created

Source from the content-addressed store, hash-verified

690
691
692class Bbox(BboxBase):
693 """
694 A mutable bounding box.
695
696 Examples
697 --------
698 **Create from known bounds**
699
700 The default constructor takes the boundary "points" ``[[xmin, ymin],
701 [xmax, ymax]]``.
702
703 >>> Bbox([[1, 1], [3, 7]])
704 Bbox([[1.0, 1.0], [3.0, 7.0]])
705
706 Alternatively, a Bbox can be created from the flattened points array, the
707 so-called "extents" ``(xmin, ymin, xmax, ymax)``
708
709 >>> Bbox.from_extents(1, 1, 3, 7)
710 Bbox([[1.0, 1.0], [3.0, 7.0]])
711
712 or from the "bounds" ``(xmin, ymin, width, height)``.
713
714 >>> Bbox.from_bounds(1, 1, 2, 6)
715 Bbox([[1.0, 1.0], [3.0, 7.0]])
716
717 **Create from collections of points**
718
719 The "empty" object for accumulating Bboxs is the null bbox, which is a
720 stand-in for the empty set.
721
722 >>> Bbox.null()
723 Bbox([[inf, inf], [-inf, -inf]])
724
725 Adding points to the null bbox will give you the bbox of those points.
726
727 >>> box = Bbox.null()
728 >>> box.update_from_data_xy([[1, 1]])
729 >>> box
730 Bbox([[1.0, 1.0], [1.0, 1.0]])
731 >>> box.update_from_data_xy([[2, 3], [3, 2]], ignore=False)
732 >>> box
733 Bbox([[1.0, 1.0], [3.0, 3.0]])
734
735 Setting ``ignore=True`` is equivalent to starting over from a null bbox.
736
737 >>> box.update_from_data_xy([[1, 1]], ignore=True)
738 >>> box
739 Bbox([[1.0, 1.0], [1.0, 1.0]])
740
741 .. warning::
742
743 It is recommended to always specify ``ignore`` explicitly. If not, the
744 default value of ``ignore`` can be changed at any time by code with
745 access to your Bbox, for example using the method `~.Bbox.ignore`.
746
747 **Properties of the ``null`` bbox**
748
749 .. note::

Callers 15

__init__Method · 0.90
_set_axis_scaleMethod · 0.90
clearMethod · 0.90
composite_imagesFunction · 0.90
make_imageMethod · 0.90
get_cursor_dataMethod · 0.90
make_imageMethod · 0.90
make_imageMethod · 0.90
paintEventMethod · 0.90
test_degenerate_polygonFunction · 0.90
test_bbox_image_invertedFunction · 0.90
test_bbox_is_finiteFunction · 0.90

Calls

no outgoing calls

Tested by 3

test_degenerate_polygonFunction · 0.72
test_bbox_image_invertedFunction · 0.72
test_bbox_is_finiteFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…