matplotlib.typing#

Typing support for Matplotlib

This module contains Type aliases which are useful for Matplotlib and potentiallydownstream libraries.

Warning

Provisional status of typing

Thetyping module and type stub files are considered provisional and may changeat any time without a deprecation period.

Color#

matplotlib.typing.ColorType=tuple[float,float,float]|str|tuple[float,float,float,float]|tuple[tuple[float,float,float]|str,float]|tuple[tuple[float,float,float,float],float]#

Any color specification accepted by Matplotlib. Seecolor.

matplotlib.typing.RGBColorType=tuple[float,float,float]|str#

Any RGB color specification accepted by Matplotlib.

matplotlib.typing.RGBAColorType=str|tuple[float,float,float,float]|tuple[tuple[float,float,float]|str,float]|tuple[tuple[float,float,float,float],float]#

Any RGBA color specification accepted by Matplotlib.

matplotlib.typing.ColourType=tuple[float,float,float]|str|tuple[float,float,float,float]|tuple[tuple[float,float,float]|str,float]|tuple[tuple[float,float,float,float],float]#

Alias ofColorType.

matplotlib.typing.RGBColourType=tuple[float,float,float]|str#

Alias ofRGBColorType.

matplotlib.typing.RGBAColourType=str|tuple[float,float,float,float]|tuple[tuple[float,float,float]|str,float]|tuple[tuple[float,float,float,float],float]#

Alias ofRGBAColorType.

Styles#

matplotlib.typing.LineStyleType#

Any line style specification accepted by Matplotlib.SeeLinestyles.

alias ofLiteral['-', 'solid', '--', 'dashed', '-.', 'dashdot', ':', 'dotted', '', 'none', ' ', 'None'] |tuple[float,Sequence[float]]

matplotlib.typing.DrawStyleType#

SeeStep Demo.

alias ofLiteral['default', 'steps', 'steps-pre', 'steps-mid', 'steps-post']

matplotlib.typing.MarkEveryType=None|int|tuple[int,int]|slice|list[int]|float|tuple[float,float]|list[bool]#

SeeMarkevery Demo.

matplotlib.typing.FillStyleType#

Marker fill styles. SeeMarker reference.

alias ofLiteral['full', 'left', 'right', 'bottom', 'top', 'none']

matplotlib.typing.CapStyleType#

Line cap styles. SeeCapStyle.

alias ofCapStyle |Literal['butt', 'projecting', 'round']

matplotlib.typing.JoinStyleType#

Line join styles. SeeJoinStyle.

alias ofJoinStyle |Literal['miter', 'round', 'bevel']

Other types#

matplotlib.typing.CoordsType#

alias ofstr |Artist |Transform |Callable[[RendererBase],Bbox |Transform] |tuple[str |Artist |Transform |Callable[[RendererBase],Bbox |Transform],str |Artist |Transform |Callable[[RendererBase],Bbox |Transform]]

matplotlib.typing.RcStyleType=str|dict[str,typing.Any]|pathlib.Path|collections.abc.Sequence[str|pathlib.Path|dict[str,typing.Any]]#

Represent a PEP 604 union type

E.g. for int | str

matplotlib.typing.HashableList(iterable=(),/)#

A nested list of Hashable values.

alias oflist[_HT |HashableList[_HT]]