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

Method __init__

lib/matplotlib/offsetbox.py:1120–1155  ·  view source on GitHub ↗

Parameters ---------- s : str Text. loc : str Location code. See `AnchoredOffsetbox`. pad : float, default: 0.4 Padding around the text as fraction of the fontsize. borderpad : float, default: 0.5 Spa

(self, s, loc, *, pad=0.4, borderpad=0.5, prop=None, **kwargs)

Source from the content-addressed store, hash-verified

1118 """
1119
1120 def __init__(self, s, loc, *, pad=0.4, borderpad=0.5, prop=None, **kwargs):
1121 """
1122 Parameters
1123 ----------
1124 s : str
1125 Text.
1126
1127 loc : str
1128 Location code. See `AnchoredOffsetbox`.
1129
1130 pad : float, default: 0.4
1131 Padding around the text as fraction of the fontsize.
1132
1133 borderpad : float, default: 0.5
1134 Spacing between the offsetbox frame and the *bbox_to_anchor*.
1135
1136 prop : dict, optional
1137 Dictionary of keyword parameters to be passed to the
1138 `~matplotlib.text.Text` instance contained inside AnchoredText.
1139
1140 **kwargs
1141 All other parameters are passed to `AnchoredOffsetbox`.
1142 """
1143
1144 if prop is None:
1145 prop = {}
1146 badkwargs = {'va', 'verticalalignment'}
1147 if badkwargs & set(prop):
1148 raise ValueError(
1149 'Mixing verticalalignment with AnchoredText is not supported.')
1150
1151 self.txt = TextArea(s, textprops=prop)
1152 fp = self.txt._text.get_fontproperties()
1153 super().__init__(
1154 loc, pad=pad, borderpad=borderpad, child=self.txt, prop=fp,
1155 **kwargs)
1156
1157
1158class OffsetImage(OffsetBox):

Callers

nothing calls this directly

Calls 3

TextAreaClass · 0.85
get_fontpropertiesMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected