Parameters ---------- s : str a string to be displayed. textprops : `~matplotlib.font_manager.FontProperties`, optional multilinebaseline : bool, optional If `True`, baseline for multiline text is adjusted so that it is (
(self, s,
textprops=None,
multilinebaseline=None,
minimumdescent=True,
)
| 691 | text. |
| 692 | """ |
| 693 | def __init__(self, s, |
| 694 | textprops=None, |
| 695 | multilinebaseline=None, |
| 696 | minimumdescent=True, |
| 697 | ): |
| 698 | """ |
| 699 | Parameters |
| 700 | ---------- |
| 701 | s : str |
| 702 | a string to be displayed. |
| 703 | |
| 704 | textprops : `~matplotlib.font_manager.FontProperties`, optional |
| 705 | |
| 706 | multilinebaseline : bool, optional |
| 707 | If `True`, baseline for multiline text is adjusted so that |
| 708 | it is (approximatedly) center-aligned with singleline |
| 709 | text. |
| 710 | |
| 711 | minimumdescent : bool, optional |
| 712 | If `True`, the box has a minimum descent of "p". |
| 713 | """ |
| 714 | if textprops is None: |
| 715 | textprops = {} |
| 716 | |
| 717 | if "va" not in textprops: |
| 718 | textprops["va"] = "baseline" |
| 719 | |
| 720 | self._text = mtext.Text(0, 0, s, **textprops) |
| 721 | |
| 722 | OffsetBox.__init__(self) |
| 723 | |
| 724 | self._children = [self._text] |
| 725 | |
| 726 | self.offset_transform = mtransforms.Affine2D() |
| 727 | self.offset_transform.clear() |
| 728 | self.offset_transform.translate(0, 0) |
| 729 | self._baseline_transform = mtransforms.Affine2D() |
| 730 | self._text.set_transform(self.offset_transform + |
| 731 | self._baseline_transform) |
| 732 | |
| 733 | self._multilinebaseline = multilinebaseline |
| 734 | self._minimumdescent = minimumdescent |
| 735 | |
| 736 | def set_text(self, s): |
| 737 | "Set the text of this area as a string." |
nothing calls this directly
no test coverage detected