2525@fmt_docstring
2626@use_alias (
2727 C = "clearance" ,
28- D = "offset" ,
2928 a = "aspatial" ,
3029 e = "find" ,
3130 f = "coltypes" ,
@@ -45,6 +44,7 @@ def text( # noqa: PLR0912, PLR0913, PLR0915
4544 fill : str | None = None ,
4645 pen : str | None = None ,
4746 justify : bool | None | AnchorCode | Sequence [AnchorCode ] = None ,
47+ offset : Sequence [float | str ] | str | None = None ,
4848 no_clip : bool = False ,
4949 projection : str | None = None ,
5050 region : Sequence [float | str ] | str | None = None ,
@@ -77,6 +77,7 @@ def text( # noqa: PLR0912, PLR0913, PLR0915
7777
7878 $aliases
7979 - B = frame
80+ - D = offset
8081 - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font
8182 - G = fill
8283 - J = projection
@@ -157,16 +158,14 @@ def text( # noqa: PLR0912, PLR0913, PLR0915
157158 pen
158159 Set the pen used to draw a rectangle around the text string (see ``clearance``)
159160 [Default is ``"0.25p,black,solid"``].
160- offset : str
161- [**j**\|\ **J**]\ *dx*\[/*dy*][**+v**\[*pen*]].
162- Offset the text from the projected (x, y) point by *dx*/\ *dy*
163- [Default is ``"0/0"``].
164- If *dy* is not specified then it is set equal to *dx*. Use **j** to
165- offset the text away from the point instead (i.e., the text
166- justification will determine the direction of the shift). Using
167- **J** will shorten diagonal offsets at corners by sqrt(2).
168- Optionally, append **+v** which will draw a line from the original
169- point to the shifted point; append a pen to change the attributes
161+ offset
162+ (*dx*, *dy*) or [**j**\|\ **J**]\ *dx*\[/*dy*][**+v**\[*pen*]].
163+ Offset the text from the projected (x, y) point by (*dx*, *dy*) [Default is
164+ (0, 0)]. If *dy* is not specified then it is set equal to *dx*. Use **j** to
165+ offset the text away from the point instead (i.e., the text justification will
166+ determine the direction of the shift). Using **J** will shorten diagonal offsets
167+ at corners by sqrt(2). Optionally, append **+v** which will draw a line from
168+ the original point to the shifted point; append a pen to change the attributes
170169 for this line.
171170 no_clip
172171 Do **not** clip text at the frame boundaries [Default is ``False``].
@@ -281,6 +280,7 @@ def text( # noqa: PLR0912, PLR0913, PLR0915
281280 )
282281
283282 aliasdict = AliasSystem (
283+ D = Alias (offset , name = "offset" , sep = "/" , size = 2 ),
284284 G = Alias (fill , name = "fill" ),
285285 N = Alias (no_clip , name = "no_clip" ),
286286 W = Alias (pen , name = "pen" ),
0 commit comments