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

Class DrawingArea

lib/matplotlib/offsetbox.py:597–706  ·  view source on GitHub ↗

The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The children can be clipped at the boundaries of the parent.

Source from the content-addressed store, hash-verified

595
596
597class DrawingArea(OffsetBox):
598 """
599 The DrawingArea can contain any Artist as a child. The DrawingArea
600 has a fixed width and height. The position of children relative to
601 the parent is fixed. The children can be clipped at the
602 boundaries of the parent.
603 """
604
605 def __init__(self, width, height, xdescent=0., ydescent=0., clip=False):
606 """
607 Parameters
608 ----------
609 width, height : float
610 Width and height of the container box.
611 xdescent, ydescent : float
612 Descent of the box in x- and y-direction.
613 clip : bool
614 Whether to clip the children to the box.
615 """
616 super().__init__()
617 self.width = width
618 self.height = height
619 self.xdescent = xdescent
620 self.ydescent = ydescent
621 self._clip_children = clip
622 self.offset_transform = mtransforms.Affine2D()
623 self.dpi_transform = mtransforms.Affine2D()
624
625 @property
626 def clip_children(self):
627 """
628 If the children of this DrawingArea should be clipped
629 by DrawingArea bounding box.
630 """
631 return self._clip_children
632
633 @clip_children.setter
634 def clip_children(self, val):
635 self._clip_children = bool(val)
636 self.stale = True
637
638 def get_transform(self):
639 """
640 Return the `~matplotlib.transforms.Transform` applied to the children.
641 """
642 return self.dpi_transform + self.offset_transform
643
644 def set_transform(self, t):
645 """
646 set_transform is ignored.
647 """
648
649 def set_offset(self, xy):
650 """
651 Set the offset of the container.
652
653 Parameters
654 ----------

Callers 14

__init__Method · 0.90
_init_legend_boxMethod · 0.90
add_offsetboxesFunction · 0.90
test_offsetbox_clippingFunction · 0.90
test_offsetbox_loc_codesFunction · 0.90
test_pickingFunction · 0.90
test_arrowprops_copiedFunction · 0.90
test_packersFunction · 0.90
annotations.pyFile · 0.90

Calls

no outgoing calls

Tested by 9

add_offsetboxesFunction · 0.72
test_offsetbox_clippingFunction · 0.72
test_offsetbox_loc_codesFunction · 0.72
test_pickingFunction · 0.72
test_arrowprops_copiedFunction · 0.72
test_packersFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…