File: text.pyi

package info (click to toggle)
matplotlib 3.10.7%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 72,820 kB
  • sloc: python: 147,545; cpp: 62,988; objc: 1,679; ansic: 1,426; javascript: 788; makefile: 92; sh: 53
file content (181 lines) | stat: -rw-r--r-- 7,019 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
from .artist import Artist
from .backend_bases import RendererBase
from .font_manager import FontProperties
from .offsetbox import DraggableAnnotation
from .path import Path
from .patches import FancyArrowPatch, FancyBboxPatch
from .textpath import (  # noqa: F401, reexported API
    TextPath as TextPath,
    TextToPath as TextToPath,
)
from .transforms import (
    Bbox,
    BboxBase,
    Transform,
)

from collections.abc import Callable, Iterable
from typing import Any, Literal
from .typing import ColorType, CoordsType

class Text(Artist):
    zorder: float
    def __init__(
        self,
        x: float = ...,
        y: float = ...,
        text: Any = ...,
        *,
        color: ColorType | None = ...,
        verticalalignment: Literal[
            "bottom", "baseline", "center", "center_baseline", "top"
        ] = ...,
        horizontalalignment: Literal["left", "center", "right"] = ...,
        multialignment: Literal["left", "center", "right"] | None = ...,
        fontproperties: str | Path | FontProperties | None = ...,
        rotation: float | Literal["vertical", "horizontal"] | None = ...,
        linespacing: float | None = ...,
        rotation_mode: Literal["default", "anchor"] | None = ...,
        usetex: bool | None = ...,
        wrap: bool = ...,
        transform_rotates_text: bool = ...,
        parse_math: bool | None = ...,
        antialiased: bool | None = ...,
        **kwargs
    ) -> None: ...
    def update(self, kwargs: dict[str, Any]) -> list[Any]: ...
    def get_rotation(self) -> float: ...
    def get_transform_rotates_text(self) -> bool: ...
    def set_rotation_mode(self, m: None | Literal["default", "anchor"]) -> None: ...
    def get_rotation_mode(self) -> Literal["default", "anchor"]: ...
    def set_bbox(self, rectprops: dict[str, Any]) -> None: ...
    def get_bbox_patch(self) -> None | FancyBboxPatch: ...
    def update_bbox_position_size(self, renderer: RendererBase) -> None: ...
    def get_wrap(self) -> bool: ...
    def set_wrap(self, wrap: bool) -> None: ...
    def get_color(self) -> ColorType: ...
    def get_fontproperties(self) -> FontProperties: ...
    def get_fontfamily(self) -> list[str]: ...
    def get_fontname(self) -> str: ...
    def get_fontstyle(self) -> Literal["normal", "italic", "oblique"]: ...
    def get_fontsize(self) -> float | str: ...
    def get_fontvariant(self) -> Literal["normal", "small-caps"]: ...
    def get_fontweight(self) -> int | str: ...
    def get_stretch(self) -> int | str: ...
    def get_horizontalalignment(self) -> Literal["left", "center", "right"]: ...
    def get_unitless_position(self) -> tuple[float, float]: ...
    def get_position(self) -> tuple[float, float]: ...
    def get_text(self) -> str: ...
    def get_verticalalignment(
        self,
    ) -> Literal["bottom", "baseline", "center", "center_baseline", "top"]: ...
    def get_window_extent(
        self, renderer: RendererBase | None = ..., dpi: float | None = ...
    ) -> Bbox: ...
    def set_backgroundcolor(self, color: ColorType) -> None: ...
    def set_color(self, color: ColorType) -> None: ...
    def set_horizontalalignment(
        self, align: Literal["left", "center", "right"]
    ) -> None: ...
    def set_multialignment(self, align: Literal["left", "center", "right"]) -> None: ...
    def set_linespacing(self, spacing: float) -> None: ...
    def set_fontfamily(self, fontname: str | Iterable[str]) -> None: ...
    def set_fontvariant(self, variant: Literal["normal", "small-caps"]) -> None: ...
    def set_fontstyle(
        self, fontstyle: Literal["normal", "italic", "oblique"]
    ) -> None: ...
    def set_fontsize(self, fontsize: float | str) -> None: ...
    def get_math_fontfamily(self) -> str: ...
    def set_math_fontfamily(self, fontfamily: str) -> None: ...
    def set_fontweight(self, weight: int | str) -> None: ...
    def set_fontstretch(self, stretch: int | str) -> None: ...
    def set_position(self, xy: tuple[float, float]) -> None: ...
    def set_x(self, x: float) -> None: ...
    def set_y(self, y: float) -> None: ...
    def set_rotation(self, s: float) -> None: ...
    def set_transform_rotates_text(self, t: bool) -> None: ...
    def set_verticalalignment(
        self, align: Literal["bottom", "baseline", "center", "center_baseline", "top"]
    ) -> None: ...
    def set_text(self, s: Any) -> None: ...
    def set_fontproperties(self, fp: FontProperties | str | Path | None) -> None: ...
    def set_usetex(self, usetex: bool | None) -> None: ...
    def get_usetex(self) -> bool: ...
    def set_parse_math(self, parse_math: bool) -> None: ...
    def get_parse_math(self) -> bool: ...
    def set_fontname(self, fontname: str | Iterable[str]) -> None: ...
    def get_antialiased(self) -> bool: ...
    def set_antialiased(self, antialiased: bool) -> None: ...

class OffsetFrom:
    def __init__(
        self,
        artist: Artist | BboxBase | Transform,
        ref_coord: tuple[float, float],
        unit: Literal["points", "pixels"] = ...,
    ) -> None: ...
    def set_unit(self, unit: Literal["points", "pixels"]) -> None: ...
    def get_unit(self) -> Literal["points", "pixels"]: ...
    def __call__(self, renderer: RendererBase) -> Transform: ...

class _AnnotationBase:
    xy: tuple[float, float]
    xycoords: CoordsType
    def __init__(
        self,
        xy,
        xycoords: CoordsType = ...,
        annotation_clip: bool | None = ...,
    ) -> None: ...
    def set_annotation_clip(self, b: bool | None) -> None: ...
    def get_annotation_clip(self) -> bool | None: ...
    def draggable(
        self, state: bool | None = ..., use_blit: bool = ...
    ) -> DraggableAnnotation | None: ...

class Annotation(Text, _AnnotationBase):
    arrowprops: dict[str, Any] | None
    arrow_patch: FancyArrowPatch | None
    def __init__(
        self,
        text: str,
        xy: tuple[float, float],
        xytext: tuple[float, float] | None = ...,
        xycoords: CoordsType = ...,
        textcoords: CoordsType | None = ...,
        arrowprops: dict[str, Any] | None = ...,
        annotation_clip: bool | None = ...,
        **kwargs
    ) -> None: ...
    @property
    def xycoords(
        self,
    ) -> CoordsType: ...
    @xycoords.setter
    def xycoords(
        self,
        xycoords: CoordsType,
    ) -> None: ...
    @property
    def xyann(self) -> tuple[float, float]: ...
    @xyann.setter
    def xyann(self, xytext: tuple[float, float]) -> None: ...
    def get_anncoords(
        self,
    ) -> CoordsType: ...
    def set_anncoords(
        self,
        coords: CoordsType,
    ) -> None: ...
    @property
    def anncoords(
        self,
    ) -> CoordsType: ...
    @anncoords.setter
    def anncoords(
        self,
        coords: CoordsType,
    ) -> None: ...
    def update_positions(self, renderer: RendererBase) -> None: ...
    # Drops `dpi` parameter from superclass
    def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...  # type: ignore[override]