|
4 | 4 | This module contains Type aliases which are useful for Matplotlib and potentially |
5 | 5 | downstream libraries. |
6 | 6 |
|
7 | | -.. admonition:: Provisional status of typing |
| 7 | +.. warning:: |
| 8 | + **Provisional status of typing** |
8 | 9 |
|
9 | 10 | The ``typing`` module and type stub files are considered provisional and may change |
10 | 11 | at any time without a deprecation period. |
|
21 | 22 | from .transforms import Bbox, Transform |
22 | 23 |
|
23 | 24 | RGBColorType: TypeAlias = tuple[float, float, float] | str |
| 25 | +"""Any RGB color specification accepted by Matplotlib.""" |
| 26 | + |
24 | 27 | RGBAColorType: TypeAlias = ( |
25 | 28 | str | # "none" or "#RRGGBBAA"/"#RGBA" hex strings |
26 | 29 | tuple[float, float, float, float] | |
|
30 | 33 | # (4-tuple, float) is odd, but accepted as the outer float overriding A of 4-tuple |
31 | 34 | tuple[tuple[float, float, float, float], float] |
32 | 35 | ) |
| 36 | +"""Any RGBA color specification accepted by Matplotlib.""" |
33 | 37 |
|
34 | 38 | ColorType: TypeAlias = RGBColorType | RGBAColorType |
| 39 | +"""Any color specification accepted by Matplotlib. See :mpltype:`color`.""" |
35 | 40 |
|
36 | 41 | RGBColourType: TypeAlias = RGBColorType |
| 42 | +"""Alias of `.RGBColorType`.""" |
| 43 | + |
37 | 44 | RGBAColourType: TypeAlias = RGBAColorType |
| 45 | +"""Alias of `.RGBAColorType`.""" |
| 46 | + |
38 | 47 | ColourType: TypeAlias = ColorType |
| 48 | +"""Alias of `.ColorType`.""" |
39 | 49 |
|
40 | 50 | LineStyleType: TypeAlias = ( |
41 | 51 | Literal["-", "solid", "--", "dashed", "-.", "dashdot", ":", "dotted", |
42 | 52 | "", "none", " ", "None"] | |
43 | 53 | tuple[float, Sequence[float]] |
44 | 54 | ) |
| 55 | +""" |
| 56 | +Any line style specification accepted by Matplotlib. |
| 57 | +See :doc:`/gallery/lines_bars_and_markers/linestyles`. |
| 58 | +""" |
| 59 | + |
45 | 60 | DrawStyleType: TypeAlias = Literal["default", "steps", "steps-pre", "steps-mid", |
46 | 61 | "steps-post"] |
| 62 | +"""See :doc:`/gallery/lines_bars_and_markers/step_demo`.""" |
| 63 | + |
47 | 64 | MarkEveryType: TypeAlias = ( |
48 | 65 | None | |
49 | 66 | int | tuple[int, int] | slice | list[int] | |
50 | 67 | float | tuple[float, float] | |
51 | 68 | list[bool] |
52 | 69 | ) |
| 70 | +"""See :doc:`/gallery/lines_bars_and_markers/markevery_demo`.""" |
53 | 71 |
|
54 | 72 | MarkerType: TypeAlias = str | path.Path | MarkerStyle |
| 73 | +""" |
| 74 | +Marker specification. See :doc:`/gallery/lines_bars_and_markers/marker_reference`. |
| 75 | +""" |
| 76 | + |
55 | 77 | FillStyleType: TypeAlias = Literal["full", "left", "right", "bottom", "top", "none"] |
| 78 | +"""Marker fill styles. See :doc:`/gallery/lines_bars_and_markers/marker_reference`.""" |
| 79 | + |
56 | 80 | JoinStyleType: TypeAlias = JoinStyle | Literal["miter", "round", "bevel"] |
| 81 | +"""Line join styles. See :doc:`/gallery/lines_bars_and_markers/joinstyle`.""" |
| 82 | + |
57 | 83 | CapStyleType: TypeAlias = CapStyle | Literal["butt", "projecting", "round"] |
| 84 | +"""Line cap styles. See :doc:`/gallery/lines_bars_and_markers/capstyle`.""" |
58 | 85 |
|
59 | 86 | CoordsBaseType = Union[ |
60 | 87 | str, |
|
0 commit comments