Parameters ---------- s : string Text. loc : str Location code. pad : float, optional Pad between the text and the frame as fraction of the font size. borderpad : float, optional Pad betwe
(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs)
| 1217 | """ |
| 1218 | |
| 1219 | def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs): |
| 1220 | """ |
| 1221 | Parameters |
| 1222 | ---------- |
| 1223 | s : string |
| 1224 | Text. |
| 1225 | |
| 1226 | loc : str |
| 1227 | Location code. |
| 1228 | |
| 1229 | pad : float, optional |
| 1230 | Pad between the text and the frame as fraction of the font |
| 1231 | size. |
| 1232 | |
| 1233 | borderpad : float, optional |
| 1234 | Pad between the frame and the axes (or *bbox_to_anchor*). |
| 1235 | |
| 1236 | prop : dictionary, optional, default: None |
| 1237 | Dictionary of keyword parameters to be passed to the |
| 1238 | `~matplotlib.text.Text` instance contained inside AnchoredText. |
| 1239 | |
| 1240 | Notes |
| 1241 | ----- |
| 1242 | Other keyword parameters of `AnchoredOffsetbox` are also |
| 1243 | allowed. |
| 1244 | """ |
| 1245 | |
| 1246 | if prop is None: |
| 1247 | prop = {} |
| 1248 | badkwargs = {'ha', 'horizontalalignment', 'va', 'verticalalignment'} |
| 1249 | if badkwargs & set(prop): |
| 1250 | warnings.warn("Mixing horizontalalignment or verticalalignment " |
| 1251 | "with AnchoredText is not supported.") |
| 1252 | |
| 1253 | self.txt = TextArea(s, textprops=prop, minimumdescent=False) |
| 1254 | fp = self.txt._text.get_fontproperties() |
| 1255 | super().__init__( |
| 1256 | loc, pad=pad, borderpad=borderpad, child=self.txt, prop=fp, |
| 1257 | **kwargs) |
| 1258 | |
| 1259 | |
| 1260 | class OffsetImage(OffsetBox): |
nothing calls this directly
no test coverage detected