@@ -16,7 +16,7 @@ from .transforms import (
1616
1717from collections .abc import Callable , Iterable
1818from typing import Any , Literal
19- from .typing import ColorType
19+ from .typing import ColorType , CoordsType
2020
2121class Text (Artist ):
2222 zorder : float
@@ -120,17 +120,11 @@ class OffsetFrom:
120120
121121class _AnnotationBase :
122122 xy : tuple [float , float ]
123- xycoords : str | tuple [str , str ] | Artist | Transform | Callable [
124- [RendererBase ], Bbox | Transform
125- ]
123+ xycoords : CoordsType
126124 def __init__ (
127125 self ,
128126 xy ,
129- xycoords : str
130- | tuple [str , str ]
131- | Artist
132- | Transform
133- | Callable [[RendererBase ], Bbox | Transform ] = ...,
127+ xycoords : CoordsType = ...,
134128 annotation_clip : bool | None = ...,
135129 ) -> None : ...
136130 def set_annotation_clip (self , b : bool | None ) -> None : ...
@@ -147,67 +141,40 @@ class Annotation(Text, _AnnotationBase):
147141 text : str ,
148142 xy : tuple [float , float ],
149143 xytext : tuple [float , float ] | None = ...,
150- xycoords : str
151- | tuple [str , str ]
152- | Artist
153- | Transform
154- | Callable [[RendererBase ], Bbox | Transform ] = ...,
155- textcoords : str
156- | tuple [str , str ]
157- | Artist
158- | Transform
159- | Callable [[RendererBase ], Bbox | Transform ]
160- | None = ...,
144+ xycoords : CoordsType = ...,
145+ textcoords : CoordsType | None = ...,
161146 arrowprops : dict [str , Any ] | None = ...,
162147 annotation_clip : bool | None = ...,
163148 ** kwargs
164149 ) -> None : ...
165150 @property
166151 def xycoords (
167152 self ,
168- ) -> str | tuple [str , str ] | Artist | Transform | Callable [
169- [RendererBase ], Bbox | Transform
170- ]: ...
153+ ) -> CoordsType : ...
171154 @xycoords .setter
172155 def xycoords (
173156 self ,
174- xycoords : str
175- | tuple [str , str ]
176- | Artist
177- | Transform
178- | Callable [[RendererBase ], Bbox | Transform ],
157+ xycoords : CoordsType ,
179158 ) -> None : ...
180159 @property
181160 def xyann (self ) -> tuple [float , float ]: ...
182161 @xyann .setter
183162 def xyann (self , xytext : tuple [float , float ]) -> None : ...
184163 def get_anncoords (
185164 self ,
186- ) -> str | tuple [str , str ] | Artist | Transform | Callable [
187- [RendererBase ], Bbox | Transform
188- ]: ...
165+ ) -> CoordsType : ...
189166 def set_anncoords (
190167 self ,
191- coords : str
192- | tuple [str , str ]
193- | Artist
194- | Transform
195- | Callable [[RendererBase ], Bbox | Transform ],
168+ coords : CoordsType ,
196169 ) -> None : ...
197170 @property
198171 def anncoords (
199172 self ,
200- ) -> str | tuple [str , str ] | Artist | Transform | Callable [
201- [RendererBase ], Bbox | Transform
202- ]: ...
173+ ) -> CoordsType : ...
203174 @anncoords .setter
204175 def anncoords (
205176 self ,
206- coords : str
207- | tuple [str , str ]
208- | Artist
209- | Transform
210- | Callable [[RendererBase ], Bbox | Transform ],
177+ coords : CoordsType ,
211178 ) -> None : ...
212179 def update_positions (self , renderer : RendererBase ) -> None : ...
213180 # Drops `dpi` parameter from superclass
0 commit comments