Add matplotlib and PIL stubs from Pylance (#51)

This commit is contained in:
Jake Bailey 2021-04-29 16:49:33 -07:00 коммит произвёл GitHub
Родитель 043fd82d38
Коммит d215731c92
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
90 изменённых файлов: 4620 добавлений и 0 удалений

7
PIL/ExifTags.pyi Normal file
Просмотреть файл

@ -0,0 +1,7 @@
# pyright: strict
from typing import Dict
TAGS: Dict[int, str]
GPSTAGS: Dict[int, str]

205
PIL/Image.pyi Normal file
Просмотреть файл

@ -0,0 +1,205 @@
# pyright: strict
from pathlib import Path
from typing import (
Any, BinaryIO, Callable, ContextManager, Dict, List, Literal, Optional,
Sequence, Tuple, Union)
from PIL.ImageFile import PyDecoder, PyEncoder
from PIL.ImageFilter import Filter
from PIL.ImagePalette import ImagePalette
_Size = Tuple[int, int]
NONE: int
FLIP_LEFT_RIGHT: int
FLIP_TOP_BOTTOM: int
ROTATE_90: int
ROTATE_180: int
ROTATE_270: int
TRANSPOSE: int
TRANSVERSE: int
AFFINE: int
EXTENT: int
PERSPECTIVE: int
QUAD: int
MESH: int
NEAREST: int
BOX: int
LINEAR: int
BILINEAR: int
HAMMING: int
BICUBIC: int
CUBIC: int
LANCZOS: int
ANTIALIAS: int
ORDERED: int
RASTERIZE: int
FLOYDSTEINBERG: int
WEB: int
ADAPTIVE: int
MEDIANCUT: int
MAXCOVERAGE: int
FASTOCTREE: int
LIBIMAGEQUANT: int
NORMAL: int
SEQUENCE: int
CONTAINER: int
def open(fp: Union[str, Path, BinaryIO], mode: str = ...) -> Image: ...
def alpha_composite(im1: Image, im2: Image) -> Image: ...
def blend(im1: Image, im2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
# TODO: args
def eval(image: Image, *args: Any) -> Image: ...
def merge(mode: str, bands: Sequence[Image]) -> Image: ...
def new(mode: str, size: _Size, color: Optional[Union[str, Tuple[int, ...]]] = ...) -> Image: ...
# TODO: Buffer protocol
def fromarray(obj: Any, mode: Optional[str] = ...) -> Image: ...
# TODO: Decoder protocol
def frombytes(mode: str, size: _Size, data: Any, decoder_name: str = ..., *args: Any) -> Image: ...
# TODO: raises NotImplementedError unconditionally; remove?
def fromstring(*args: Any, **kwargs: Any) -> None: ...
# TODO: Decoder protocol
def frombuffer(mode: str, size: _Size, data: Any, decoder_name: str = ..., *args: Any) -> Image: ...
def register_open(id: str, factory: Callable, accept: Optional[Callable] = ...) -> None: ...
def register_decoder(name: str, decoder: Callable) -> None: ...
def register_mime(name: str, mimetype: str) -> None: ...
def register_save(id: str, driver: Callable) -> None: ...
def register_encoder(name: str, encoder: Callable) -> None: ...
def register_extension(id: str, extension: str) -> None: ...
class Image(ContextManager[Image]):
filename: str
format: Optional[str]
mode: str
palette: Optional[ImagePalette]
info: Dict[Any, Any]
def __init__(self) -> None: ...
def alpha_composite(self, im: Image, dest: Tuple[int, int] = ..., source: Tuple[int, int] = ...) -> None: ...
# TODO: Literal for palette from constants
def convert(self, mode: Optional[str] = ..., matrix: Optional[Tuple[float, ...]] = ..., dither: Optional[str] = ..., palette: int = ..., colors: int = ...) -> Image: ...
def copy(self) -> Image: ...
def crop(self, box: Optional[Tuple[int, int, int, int]] = ...) -> Image: ...
def draft(self, mode: str, size: _Size) -> None: ...
def filter(self, filter: Union[Filter, Callable[..., Filter]]) -> Image: ...
def bands(self) -> Tuple[str, ...]: ...
def getbbox(self) -> Tuple[int, int, int, int]: ...
def getcolors(self, maxcolors: int = ...) -> List[Tuple[int, int]]: ...
def getdata(self, band: Optional[int] = ...) -> Sequence[Any]: ...
def getextrema(self) -> Union[Tuple[int, int], Tuple[Tuple[int, int], ...]]: ...
def getpalette(self) -> List[int]: ...
def getpixel(self, xy: Tuple[int, int]) -> Union[int, Tuple[int, ...]]: ...
# TODO: Better type for extrema
def histogram(self, mask: Optional[Image] = ..., extrema: Optional[Tuple[Any, ...]] = ...) -> List[int]: ...
# TODO: raises NotImplementedError unconditionally; remove?
def offset(self, xoffset: Any, yoffset: Any = ...) -> None: ...
def paste(self, im: Union[Image, int, Tuple[int, ...]], box: Optional[Union[Tuple[int, int, int, int], Tuple[int, int]]] = ..., mask: Optional[Image] = ...) -> None: ...
# TODO: type lut
def point(self, lut: Any, mode: Optional[str] = ...) -> Image: ...
# TODO: "color value"?
def putalpha(self, alpha: Union[Image, int]) -> None: ...
# TODO: Sequence of what?
def putdata(self, data: Sequence[Any], scale: float = ..., offset: float = ...) -> None: ...
def putpalette(self, data: Union[List[int], str], rawmode: str = ...) -> None: ...
def putpixel(self, xy: Tuple[int, int], value: Union[int, Tuple[int, ...]]) -> None: ...
# TODO: type palette
def quantize(self, colors: int = ..., method: Optional[int] = ..., kmneans: int = ..., palette: Optional[Any] = ..., dither: int = ...) -> Image: ...
def resize(self, size: _Size, resample: int = ..., box: Optional[Tuple[int, int, int, int]] = ..., reducing_gap: Optional[float] = ...) -> Image: ...
def remap_palette(self, dest_map: Sequence[int], source_palette: Optional[bytes] = ...) -> Image: ...
# TODO: type fillcolor
def rotate(self, angle: float, resample: int = ..., expand: Union[int, bool] = ..., center: Optional[Tuple[int, int]] = ..., translate: Optional[Tuple[int, int]] = ..., fillcolor: Optional[Any] = ...) -> Image: ...
def save(self, fp: Union[str, Path, BinaryIO], format: Optional[str] = ..., **params: Any) -> None: ...
def seek(self, frame: int) -> None: ...
def show(self, title: Optional[str] = ..., command: Optional[str] = ...) -> None: ...
# TODO: type "bands"
def split(self) -> Tuple[Any, ...]: ...
def getchannel(self, channel: Union[int, str]) -> Image: ...
def tell(self) -> int: ...
def thumbnail(self, size: _Size, resample: int = ..., reducing_gap: float = ...) -> None: ...
def tobitmap(self, name: str = ...) -> str: ...
def tobytes(self, encoder_name: str = ..., *args: Any) -> bytes: ...
# TODO: raises NotImplementedError unconditionally; remove?
def tostring(self, *args: Any, **kw: Any) -> None: ...
# TODO: type fillcolor
def transform(self, size: _Size, method: int = ..., data: Optional[Any] = ..., resample: int = ..., fill: Any = ..., fillcolor: Optional[Any] = ...) -> Image: ...
def transpose(self, method: int) -> Image: ...
def verify(self) -> None: ...
# TODO: raises NotImplementedError unconditionally; remove?
def fromstring(self, *args: Any, **kw: Any) -> None: ...
def load(self) -> None: ...
def close(self) -> None: ...
@property
def width(self) -> int: ...
@property
def height(self) -> int: ...
@property
def size(self) -> _Size: ...

41
PIL/ImageChops.pyi Normal file
Просмотреть файл

@ -0,0 +1,41 @@
# pyright: strict
from typing import Optional
from PIL.Image import Image
def add(image1: Image, image2: Image, scale: float = ..., offset: float = ...) -> Image: ...
def add_modulo(image1: Image, image2: Image) -> Image: ...
def blend(image1: Image, image2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
def constant(image: Image, value: int) -> Image: ...
def darker(image1: Image, image2: Image) -> Image: ...
def difference(image1: Image, image2: Image) -> Image: ...
def duplicate(image: Image) -> Image: ...
def invert(image: Image) -> Image: ...
def lighter(image1: Image, image2: Image) -> Image: ...
def logical_and(image1: Image, image2: Image) -> Image: ...
def logical_or(image1: Image, image2: Image) -> Image: ...
def logical_xor(image1: Image, image2: Image) -> Image: ...
def multiply(image1: Image, image2: Image) -> Image: ...
def offset(image: Image, xoffset: int, yoffset: Optional[int]) -> Image: ...
def screen(image1: Image, image2: Image) -> Image: ...
def subtract(image1: Image, image2: Image, scale: float = ..., offset: float = ...) -> Image: ...
def subtract_modulo(image1: Image, image2: Image) -> Image: ...

17
PIL/ImageColor.pyi Normal file
Просмотреть файл

@ -0,0 +1,17 @@
# pyright: strict
from typing import Tuple, Union
def getrgb(color: str) -> Union[
Tuple[int, int, int], # (red, green, blue)
Tuple[int, int, int, int] # (red, green, blue, alpha)
]: ...
def getcolor(color: str, mode: str) -> Union[
Tuple[int], # (graylevel)
Tuple[int, int], # (graylevel, alpha)
Tuple[int, int, int], # (red, green, blue)
Tuple[int, int, int, int] # (red, green, blue, alpha)
]: ...

93
PIL/ImageDraw.pyi Normal file
Просмотреть файл

@ -0,0 +1,93 @@
# pyright: strict
from typing import Any, List, Literal, Optional, Sequence, Tuple, Union
from PIL.Image import Image
from PIL.ImageFont import ImageFont
_XY = Union[Sequence[Tuple[int, int]], Sequence[int]]
_Color = Any # TODO
def Draw(im: Image, mode: Optional[str] = ...) -> None: ...
class ImageDraw:
def __init__(self, im: Image, mode: Optional[str] = ...) -> None: ...
def getfont(self) -> ImageFont: ...
def arc(self, xy: _XY, start: float, end: float, fill: Optional[_Color] = ..., width: int = ...): ...
def bitmap(self, xy: _XY, bitmap: Image, fill: Optional[_Color] = ...) -> None: ...
def chord(self, xy: _XY, start: float, end: float, fill: Optional[_Color] = ..., width: int = ...) -> None: ...
def ellipse(self, xy: _XY, fill: Optional[_Color] = ..., outline: Optional[_Color] = ..., width: int = ...) -> None: ...
def line(self, xy: _XY, fill: Optional[_Color], width: int = ..., joint: Optional[Literal["curve"]] = ...) -> None: ...
def pieslice(self, xy: _XY, start: float, end: float, fill: Optional[_Color] = ..., outline: Optional[_Color] = ..., width: int = ...) -> None: ...
def point(self, xy: _XY, fill: Optional[_Color] = ...) -> None: ...
def polygon(self, xy: _XY, fill: Optional[_Color] = ..., outline: Optional[_Color] = ...) -> None: ...
def rectangle(self, xy: _XY, fill: Optional[_Color] = ..., outline: Optional[_Color] = ..., width: int = ...) -> None: ...
def shape(self, shape: Any, fill: Optional[_Color] = ..., outline: Optional[_Color] = ...) -> None: ...
def text(
self,
xy: _XY,
text: str,
fill: Optional[_Color] = ...,
font: Optional[ImageFont] = ...,
anchor: Optional[Any] = ..., # Appears to be unused and undocumented.
spacing: int = ...,
align: Literal["left", "center", "right"] = ...,
direction: Optional[Literal["rtl", "tlr", "ttb"]] = ...,
features: Optional[List[str]] = ...,
language: Optional[str] = ...,
stroke_width: int = ...,
stroke_fill: Optional[_Color] = ...
) -> None: ...
def multiline_text(
self,
xy: _XY,
text: str,
fill: Optional[_Color] = ...,
font: Optional[ImageFont] = ...,
anchor: Optional[Any] = ..., # Appears to be unused and undocumented.
spacing: int = ...,
align: Literal["left", "center", "right"] = ...,
direction: Optional[Literal["rtl", "tlr", "ttb"]] = ...,
features: Optional[List[str]] = ...,
language: Optional[str] = ...
) -> None: ...
def textsize(
self,
text: str,
font: Optional[ImageFont] = ...,
spacing: int = ...,
direction: Optional[Literal["rtl", "tlr", "ttb"]] = ...,
features: Optional[List[str]] = ...,
language: Optional[str] = ...,
stroke_width: int = ...
) -> int: ...
def multiline_textsize(
self,
text: str,
font: Optional[ImageFont] = ...,
spacing: int = ...,
direction: Optional[Literal["rtl", "tlr", "ttb"]] = ...,
features: Optional[List[str]] = ...,
language: Optional[str] = ...,
stroke_width: int = ...
) -> int: ...
# TODO: return types
def getdraw(im: Optional[Image] = ..., hints: Sequence[str] = ...) -> Tuple[Any, Any]: ...
def floodfill(image: Image, xy: _XY, value: _Color, border: Optional[_Color], thresh: int = ...) -> None: ...

23
PIL/ImageEnhance.pyi Normal file
Просмотреть файл

@ -0,0 +1,23 @@
# pyright: strict
from PIL.Image import Image
class _Enhance:
def enhance(self, factor: float) -> Image: ...
class Color(_Enhance):
image: Image
def __init__(self, image: Image) -> None: ...
class Contrast(_Enhance):
image: Image
def __init__(self, image: Image) -> None: ...
class Brightness(_Enhance):
image: Image
def __init__(self, image: Image) -> None: ...
class Sharpness(_Enhance):
image: Image
def __init__(self, image: Image) -> None: ...

23
PIL/ImageFile.pyi Normal file
Просмотреть файл

@ -0,0 +1,23 @@
# pyright: strict
from PIL.Image import Image
from typing import Any, IO, Optional, Tuple
class Parser:
def close(self) -> Image: ...
def feed(self, data: bytes) -> None: ...
def reset(self) -> None: ...
class PyDecoder:
def cleanup(self) -> None: ...
def decode(self, buffer: bytes) -> Tuple[int, int]: ...
def init(self, *args: Any) -> None: ...
def set_as_raw(self, data: bytes, rawmode: Optional[str] = ...) -> None: ...
def setfd(self, fd: IO[Any]) -> None: ...
# TODO: core image object
def setimage(self, im: Any, extents: Optional[Tuple[int, int, int, int]]) -> None: ...
# INCOMPLETE
def __getattr__(name: str) -> Any: ...

90
PIL/ImageFilter.pyi Normal file
Просмотреть файл

@ -0,0 +1,90 @@
# pyright: strict
from typing import (
Any, Callable, List, Optional, Sequence, Tuple, Type, TypeVar, Union)
_S = TypeVar("_S")
class Filter: ...
class MultibandFilter(Filter): ...
class BuiltinFilter(MultibandFilter): ...
class Color3DLUT(MultibandFilter):
def __init__(
self,
size: Union[int, Tuple[int, int, int]],
table: Union[List[float], List[Tuple[float, ...]]], # TODO: apparently accepts numpy
channels: int = ...,
target_mode: Optional[str] = ...,
**kwargs: Any
) -> None: ...
@classmethod
def generate(
cls: Type[_S],
size: Union[int, Tuple[int, int, int]],
callback: Callable[[float, float, float], Any],
channels: int = ...,
target_mode: Optional[str] = ...
) -> _S: ...
def transform(
self: _S,
callback: Callable[[float, float, float], Any],
with_normals: bool = ...,
channels: Optional[int] = ...,
target_mode: Optional[str] = ...
) -> _S: ...
class BoxBlur(MultibandFilter):
def __init__(self, radius: float) -> None: ...
class GaussianBlur(MultibandFilter):
def __init__(self, radius: float = ...) -> None: ...
class UnsharpMask(MultibandFilter):
def __init__(self, radius: float = ..., percent: int = ..., threshold: int = ...) -> None: ...
class Kernel(BuiltinFilter):
def __init__(self, size: Tuple[int, int], kernel: Sequence[float], scale: Optional[float] = ..., offset: float = ...) -> None: ...
class RankFilter(Filter):
def __init__(self, size: int, rank: int) -> None: ...
class MedianFilter(RankFilter):
def __init__(self, size: int = ...) -> None: ...
class MinFilter(RankFilter):
def __init__(self, size: int = ...) -> None: ...
class MaxFilter(RankFilter):
def __init__(self, size: int = ...) -> None: ...
class ModeFilter(RankFilter):
def __init__(self, size: int = ...) -> None: ...
class BLUR(BuiltinFilter): ...
class CONTOUR(BuiltinFilter): ...
class DETAIL(BuiltinFilter): ...
class EDGE_ENHANCE(BuiltinFilter): ...
class EDGE_ENHANCE_MORE(BuiltinFilter): ...
class EMBOSS(BuiltinFilter): ...
class FIND_EDGES(BuiltinFilter): ...
class SHARPEN(BuiltinFilter): ...
class SMOOTH(BuiltinFilter): ...
class SMOOTH_MORE(BuiltinFilter): ...

48
PIL/ImageFont.pyi Normal file
Просмотреть файл

@ -0,0 +1,48 @@
# pyright: strict
from typing import Any, Callable, IO, List, MutableMapping, Optional, Tuple, Union
LAYOUT_BASIC: int
LAYOUT_RAQM: int
_Font = Union[str, IO[Any]]
def load(filename: str) -> ImageFont: ...
def load_path(filename: str) -> ImageFont: ...
def truetype(font: Optional[_Font], size: int = ..., index: int = ..., encoding: str = ..., layout_engine: Optional[int] = ...) -> ImageFont: ...
def load_default() -> ImageFont: ...
class ImageFont:
def getmask(self, text: str, mode: str = ..., *args: Any, **kwargs: Any) -> Any: ... # TODO: Type core?
def getsize(self, *args: Any, **kwargs: Any) -> Tuple[int, int]: ...
class FreeTypeFont:
def __init__(self, font: Optional[_Font] = ..., size: int = ..., index: int = ..., encoding: str = ..., layout_engine: Optional[int] = ...) -> None: ...
def font_variant(self, font: Optional[_Font] = ..., size: int = ..., index: int = ..., encoding: str = ..., layout_engine: Optional[int] = ...) -> FreeTypeFont: ...
# TODO: Mapping of what?
def get_variation_axes(self) -> List[MutableMapping[str, Any]]: ...
def set_variation_axes(self, axes: List[MutableMapping[str, Any]]) -> None: ...
def getmask(self, text: str, mode: str = ..., direction: Optional[str] = ..., features: Optional[List[str]] = ..., language: Optional[str] = ..., stroke_width: int = ...) -> Any: ... # TODO: Type core?
def getmask2(self, text: str, mode: str = ..., fill: Callable = ..., direction: Optional[str] = ..., features: Optional[List[str]] = ..., language: Optional[str] = ..., stroke_width: int = ...) -> Any: ... # TODO: Type core?
def getmetrics(self) -> Tuple[int, int]: ...
def getname(self) -> Tuple[str, str]: ...
def getoffset(self, text: str) -> Tuple[int, int]: ...
def getsize(self, text: str, direction: Optional[str] = ..., features: Optional[List[str]] = ..., language: Optional[str] = ..., stroke_width: int = ...) -> Tuple[int, int]: ...
def getsize_multiline(self, text: str, direction: Optional[str] = ..., spacing: int = ..., direction: Optional[str] = ..., features: Optional[List[str]] = ..., language: Optional[str] = ..., stroke_width: int = ...) -> Tuple[int, int]: ...
def set_variation_by_axes(self, axes: List[Any]) -> None: ...
def set_variation_by_name(self, name: str) -> None: ...
class TransposedFont:
def __init__(self, font: _Font, orientation: Optional[int] = ...) -> None: ...

12
PIL/ImageGrab.pyi Normal file
Просмотреть файл

@ -0,0 +1,12 @@
# pyright: strict
import sys
from typing import List, Optional, Tuple, Union
from PIL.Image import Image
def grab(bbox: Optional[Tuple[int, int, int, int]], include_layered_windows: bool = ..., all_screens: bool = ...) -> Image: ...
# TODO: Conditionally define this based on Windows/macOS.
def grabclipboard() -> Optional[Union[Image, List[str]]]: ...

8
PIL/ImageMath.pyi Normal file
Просмотреть файл

@ -0,0 +1,8 @@
# pyright: strict
from PIL.Image import Image
from typing import Any, Dict, Mapping, Tuple, Union
# TODO: Docs say eval(expression, environment), implementation looks as below.
def eval(expression: str, _dict: Dict[str, Image] = ..., **kw: Image) -> Any: ... # This function is a wrapper around builtins.eval, so could produce anything.

33
PIL/ImageMorph.pyi Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# pyright: strict
from typing import List, Optional, Tuple
from PIL.Image import Image
class LutBuilder:
def __init__(self, patterns: Optional[List[str]] = ..., op_name: Optional[str] = ...) -> None: ...
def add_patterns(self, patterns: List[str]) -> None: ...
def build_default_lut(self) -> None: ...
def build_lut(self) -> bytearray: ...
def get_lut(self) -> bytearray: ...
class MorphOp:
def __init__(self, lut: Optional[bytearray], op_name: Optional[str] = ..., patterns: Optional[List[str]] = ...) -> None: ...
def apply(self, image: Image) -> Tuple[int, Image]: ...
def get_on_pixels(self, image: Image) -> List[Tuple[int, int]]: ...
def load_lut(self, filename: str) -> None: ...
def match(self, image: Image) -> List[Tuple[int, int]]: ...
def save_lut(self, filename: str) -> None: ...
def set_lut(self, lut: bytearray) -> None: ...

42
PIL/ImageOps.pyi Normal file
Просмотреть файл

@ -0,0 +1,42 @@
# pyright: strict
from typing import Any, Optional, Protocol, Tuple, Union
from PIL.Image import Image, _Size
def autocontrast(image: Image, cutoff: int = ..., ignore: Optional[int] = ...) -> Image: ...
def colorize(image: Image, black: int, white: int, mid: Optional[int] = ..., blackpoint: int = ..., whitepoint: int = ..., midpoint: int = ...) -> Image: ...
# For color, see Image.new.
def pad(image: Image, size: _Size, method: int = ..., color: Optional[Union[str, Tuple[int, ...]]] = ..., centering: Tuple[float, float] = ...) -> Image: ...
def crop(image: Image, border: int = ...) -> Image: ...
def scale(image: Image, factor: float, resample: int = ...) -> Image: ...
class _Deformer(Protocol):
def getmesh(self) -> Any: ...
def deform(image: Image, deformer: _Deformer, resample: int = ...) -> Image: ...
def equalize(image: Image, mask: Optional[Image] = ...) -> Image: ...
# TODO: make fill have a color type
def expand(image: Image, border: int, fill: int = ...) -> Image: ...
def fit(image: Image, size: _Size, method: int = ..., bleed: float = ..., centering: Tuple[float, float] = ...) -> Image: ...
def flip(image: Image) -> Image: ...
def grayscale(image: Image) -> Image: ...
def invert(image: Image) -> Image: ...
def mirror(image: Image) -> Image: ...
def posterize(image: Image, bits: int) -> Image: ...
def solarize(image: Image, threshold: int = ...) -> Image: ...
def exif_transpose(image: Image) -> Image: ...

18
PIL/ImagePalette.pyi Normal file
Просмотреть файл

@ -0,0 +1,18 @@
# pyright: strict
from typing import Any, Optional, Sequence, TextIO, Tuple, Union
class ImagePalette:
# Docs say "bytearray, array, or list of int", which may as well be Sequence[int].
def __init__(self, mode: str = ..., palette: Optional[Sequence[int]] = ..., size: int = ...) -> None: ...
def getcolor(self, color: Tuple[int, int, int]) -> int: ...
def getdata(self) -> Tuple[str, bytes]: ...
def save(self, fp: Union[str, TextIO]) -> None: ...
def tobytes(self) -> bytes: ...
def tostring(self) -> str: ...

20
PIL/ImagePath.pyi Normal file
Просмотреть файл

@ -0,0 +1,20 @@
# pyright: strict
from typing import Any, Callable, List, Sequence, Tuple, Union
_XY = Union[Sequence[Tuple[int, int]], Sequence[int]]
class Path:
def __init__(self, xy: _XY) -> None: ...
def compact(self, distance: int = ...) -> int: ...
def getbbox(self) -> Tuple[int, int, int, int]: ...
def map(self, function: Callable) -> Any: ...
# TODO: Is flat a boolean?
# TODO: overloads based on flat
def tolist(self, flat: int = ...) -> List[Union[Tuple[int, int], int]]: ...

8
PIL/ImageQt.pyi Normal file
Просмотреть файл

@ -0,0 +1,8 @@
# pyright: strict
# TODO: Subclass of QtGui.QImage
from PIL.Image import Image
class ImageQt:
def __init__(self, image: Image) -> None: ...

11
PIL/ImageSequence.pyi Normal file
Просмотреть файл

@ -0,0 +1,11 @@
# pyright: strict
import typing
from PIL.Image import Image
class Iterator(typing.Iterator[Image]):
def __init__(self, im: Image) -> None: ...
def __getitem__(self, i: int) -> Image: ...

20
PIL/ImageStat.pyi Normal file
Просмотреть файл

@ -0,0 +1,20 @@
# pyright: strict
from typing import List, Optional, Tuple, Union
from PIL.Image import Image
class Stat:
# These are implemented via __getattr__, but show them as regular members.
extrema: List[Tuple[int, int]]
count: List[int]
sum: List[int]
sum2: List[int]
mean: List[float]
median: List[int]
rms: List[float]
var: List[float]
stddev: List[float]
def __init__(self, image_or_list: Union[Image, List[int]], mask: Optional[Image] = ...) -> None: ...

22
PIL/PSDraw.pyi Normal file
Просмотреть файл

@ -0,0 +1,22 @@
# pyright: strict
from PIL.Image import Image
from typing import Any, IO, Optional, Tuple
class PSDraw:
def __init__(self, fp: Optional[IO[Any]]) -> None: ...
def begin_document(self, id: Optional[Any] = ...) -> None: ...
def end_document(self) -> None: ...
def image(self, box: Tuple[int, int, int, int], im: Image, dpi: Optional[float] = ...) -> None: ...
def line(self, xy0: Tuple[int, int], xy1: Tuple[int, int]) -> None: ...
def rectangle(self, box: Tuple[int, int, int, int]) -> None: ...
def setfont(self, font: str, size: int) -> None: ...
def text(self, xy: Tuple[int, int], text: str) -> None: ...

6
PIL/README.md Normal file
Просмотреть файл

@ -0,0 +1,6 @@
Pillow stubs at 7.0.0.
Missing:
- `Image.core` stubs (for internal C apis exposed outward)
- Plugin APIs

30
PIL/TiffTags.pyi Normal file
Просмотреть файл

@ -0,0 +1,30 @@
# pyright: strict
from typing import Dict, NamedTuple, Optional, Tuple
BYTE: int
ASCII: int
SHORT: int
LONG: int
RATIONAL: int
SIGNED_BYTE: int
UNDEFINED: int
SIGNED_SHORT: int
SIGNED_LONG: int
SIGNED_RATIONAL: int
FLOAT: int
DOUBLE: int
class TagInfo(NamedTuple):
value: int
name: str
type: Optional[int]
length: Optional[int]
enum: Optional[Dict[str, int]]
def cvt_enum(self, value: str) -> int: ...
TAGS_V2: Dict[int, TagInfo]
TAGS: Dict[int, str]
TYPES: Dict[int, str]

9
PIL/__init__.pyi Normal file
Просмотреть файл

@ -0,0 +1,9 @@
from typing import List
__version__: str
_plugins: List[str]
class UnidentifiedImageError(IOError):
pass

44
matplotlib/__init__.pyi Normal file
Просмотреть файл

@ -0,0 +1,44 @@
# COMPLETE
from typing import Any, AnyStr, ContextManager, Dict, Literal, Mapping, MutableMapping, Optional, Pattern, Sequence, Union
def use(backend: str, warn: bool = ..., force: bool = ...) -> None: ...
def get_backend() -> str: ...
rcParams: RcParams
def rc_context(rc: Optional[Mapping[Any, Any]] = ..., fname: Optional[str] = ...) -> ContextManager[None]: ...
def rc(group: Union[str, Sequence[str]], **kwargs: Any) -> None: ...
def rc_file(fname: str, *, use_default_template: bool = ...) -> None: ...
def rcdefaults() -> None: ...
def rc_file_defaults() -> None: ...
# TODO: Str -> Any?
class RcParams(MutableMapping[Any, Any]):
validate: Dict[str, Any]
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def copy(self) -> Dict[Any, Any]: ...
def find_all(self, pattern: Union[AnyStr, Pattern[AnyStr]]) -> RcParams: ...
def rc_params(fail_on_error: bool = ...) -> RcParams: ...
def rc_params_from_file(fname: str, fail_on_error: bool = ..., use_default_template: bool = ...) -> RcParams: ...
def matplotlib_fname() -> str: ...
def interactive(b: bool) -> None: ...
def is_interactive() -> bool: ...
def set_loglevel(level: Literal["notset", "debug", "info", "warning", "error", "critical"]) -> None: ...
def get_configdir() -> str: ...
def get_cachedir() -> str: ...

15
matplotlib/_typing.pyi Normal file
Просмотреть файл

@ -0,0 +1,15 @@
from typing import Callable
from numpy import ndarray as ndarray
from numpy.typing import ArrayLike as ArrayLike
from numpy.typing import _ScalarLike
Scalar = _ScalarLike
# For writing stubs without numpy installed.
# from typing import Any
# ndarray = Any
# ArrayLike = Any
# Scalar = Any
_DetrendCallable = Callable[[ArrayLike], ArrayLike]

76
matplotlib/afm.pyi Normal file
Просмотреть файл

@ -0,0 +1,76 @@
# COMPLETE
from typing import (BinaryIO, List, Literal, NamedTuple, Optional, Tuple,
Union, overload)
class CharMetrics(NamedTuple):
width: float
name: str
bbox: List[int]
class CompositePart(NamedTuple):
name: str
dx: float
dy: float
class AFM:
def __init__(self, fh: BinaryIO) -> None: ...
@property
def postscript_name(self) -> str: ...
@property
def family_name(self) -> str: ...
def get_angle(self) -> float: ...
@overload
def get_bbox_char(self, c: str, isord: Literal[False] = ...) -> List[int]: ...
@overload
def get_bbox_char(self, c: int, isord: Literal[True] = ...) -> List[int]: ...
@overload
def get_bbox_char(self, c: Union[str, int], isord: bool = ...) -> List[int]: ...
def get_capheight(self) -> float: ...
def get_familyname(self) -> str: ...
def get_fontname(self) -> str: ...
def get_fullname(self) -> str: ...
@overload
def get_height_char(self, c: str, isord: Literal[False] = ...) -> int: ...
@overload
def get_height_char(self, c: int, isord: Literal[True] = ...) -> int: ...
@overload
def get_height_char(self, c: Union[str, int], isord: bool = ...) -> int: ...
def get_horizontal_stem_width(self) -> float: ...
def get_kern_dist(self, c1: Union[str, int], c2: Union[str, int]) -> float: ...
def get_kern_dist_from_name(self, name1: str, name2: str) -> float: ...
@overload
def get_name_char(self, c: str, isord: Literal[False] = ...) -> str: ...
@overload
def get_name_char(self, c: int, isord: Literal[True] = ...) -> str: ...
@overload
def get_name_char(self, c: Union[str, int], isord: bool = ...) -> str: ...
def get_str_bbox(self, s: Union[str, bytes]) -> Tuple[float, float, float, float, float]: ...
def get_str_bbox_and_descent(self, s: Union[str, bytes]) -> Tuple[float, float, float, float, float]: ...
def get_underline_thickness(self) -> float: ...
def get_vertical_stem_width(self) -> Optional[float]: ...
def get_weight(self) -> str: ...
@overload
def get_width_char(self, c: str, isord: Literal[False] = ...) -> float: ...
@overload
def get_width_char(self, c: int, isord: Literal[True] = ...) -> float: ...
@overload
def get_width_char(self, c: Union[str, int], isord: bool = ...) -> float: ...
def get_width_from_char_name(self, name: str) -> float: ...
def get_xheight(self) -> float: ...
def string_width_height(self, s: str) -> Tuple[float, float]: ...

205
matplotlib/animation.pyi Normal file
Просмотреть файл

@ -0,0 +1,205 @@
# COMPLETE
import abc
from typing import (
Any,
Callable,
ContextManager,
Dict,
Generic,
Iterable,
Iterator,
List,
Literal,
Optional,
Protocol,
Sequence,
Tuple,
TypeVar,
Union,
)
from matplotlib.artist import Artist
from matplotlib.figure import Figure
_Frame = TypeVar("_Frame")
class Animation(Generic[_Frame]):
def __init__(self, fig: Figure, event_source: Optional[object] = ..., blit: bool = ...) -> None: ...
def new_frame_seq(self) -> Iterator[_Frame]: ...
def new_saved_frame_seq(self) -> Iterator[_Frame]: ...
def save(
self,
filename: str,
writer: Optional[Union[MovieWriter, str]],
fps: Optional[int] = ...,
dpi: Optional[Union[float, Literal['figure']]] = ...,
codec: Optional[str] = ...,
bitrate: Optional[int] = ...,
extra_args: Optional[Sequence[str]] = ...,
metadata: Optional[Dict[str, str]] = ...,
extra_anim: Optional[Sequence[Animation[Any]]] = ...,
savefig_kwargs: Optional[Dict[str, Any]] = ...,
*,
progress_callback: Optional[Callable[[int, int], Any]] = ...
) -> None: ...
def to_html5_video(self, embed_limit: Optional[float] = ...) -> str: ...
def to_jshtml(self, fps: Optional[int] = ..., embed_frames: bool = ..., default_mode: Optional[Literal['loop', 'once']] = ...) -> str: ...
class TimedAnimation(Animation[_Frame]):
def __init__(
self,
fig: Figure,
interval: int = ...,
repeat_delay: int = ...,
repeat: bool = ...,
event_source: Optional[object] = ...,
*args: Any,
**kwarg: Any
) -> None: ...
class _AnimationFunc(Protocol[_Frame]):
def __call__(self, frame: _Frame, *fargs: Any) -> Iterable[Artist]: ...
class FuncAnimation(TimedAnimation[_Frame]):
def __init__(
self,
fig: Figure,
func: _AnimationFunc[_Frame],
frames: Optional[Union[Iterable[_Frame], int, Callable[[], Any]]] = ...,
init_func: Optional[Callable[[], Iterable[_Frame]]] = ...,
fargs: Optional[Tuple[Any, ...]] = ...,
save_count: Optional[int] = ...,
*,
cache_frame_data: bool = ...,
**kwargs: Any
) -> None: ...
class ArtistAnimation(TimedAnimation[Artist]):
def __init__(
self,
fig: Figure,
artists: Sequence[Artist],
*args: Any,
**kwargs: Any
) -> None: ...
_T = TypeVar("_T", bound=AbstractMovieWriter)
class AbstractMovieWriter(abc.ABC):
def __init__(
self,
fps: int = ...,
metadata: Optional[Dict[str, str]] = ...,
codec: Optional[str] = ...,
bitrate: Optional[int] = ...
) -> None: ...
@abc.abstractmethod
def setup(self, fig: Figure, outfile: str, dpi: Optional[float] = ...) -> None: ...
@property
def frame_size(self) -> Tuple[int, int]: ...
@abc.abstractmethod
def grab_frame(self, **savefig_kwargs: Any) -> None: ...
@abc.abstractmethod
def finish(self) -> None: ...
def saving(self: _T, fig: Figure, outfile: str, dpi: float, *args: Any, **kwargs: Any) -> ContextManager[_T]: ...
class MovieWriter(AbstractMovieWriter):
def __init__(
self,
fps: int = ...,
codec: Optional[str] = ...,
bitrate: Optional[int] = ...,
extra_args: Optional[Sequence[str]] = ...,
metadata: Optional[Dict[str, str]] = ...
) -> None: ...
@classmethod
def bin_path(cls) -> str: ...
@classmethod
def isAvailable(cls) -> bool: ...
class FileMovieWriter(MovieWriter):
...
class PillowWriter(AbstractMovieWriter):
@classmethod
def isAvailable(cls) -> bool: ...
class HTMLWriter(FileMovieWriter):
supported_formats: List[str]
def __init__(
self,
fps: int = ...,
codec: Optional[str] = ...,
bitrate: Optional[int] = ...,
extra_args: Optional[Sequence[str]] = ...,
metadata: Optional[Dict[str, str]] = ...,
embed_frames: bool = ...,
default_mode: Literal['loop', 'once', 'reflect'] = ...,
embed_limit: Optional[int] = ...
) -> None: ...
@classmethod
def isAvailable(cls) -> bool: ...
class FFMpegBase:
@property
def output_args(self) -> List[str]: ...
@classmethod
def isAvailable(cls) -> bool: ...
class FFMpegWriter(FFMpegBase, MovieWriter): ...
class FFMpegFileWriter(FFMpegBase, FileMovieWriter):
supported_formats: List[str]
class AVConvBase(FFMpegBase): ...
class AVConvWriter(AVConvBase, FFMpegWriter): ...
class AVConvFileWriter(AVConvBase, FFMpegFileWriter): ...
class ImageMagickBase:
@property
def delay(self) -> float: ...
@property
def output_args(self) -> List[str]: ...
@classmethod
def bin_path(cls) -> str: ...
@classmethod
def isAvailable(cls) -> bool: ...
class ImageMagickWriter(ImageMagickBase, MovieWriter): ...
class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):
supported_formats: List[str]
class MovieWriterRegistry:
def ensure_not_dirty(self) -> None: ...
def is_available(self, name: str) -> bool: ...
def list(self) -> List[MovieWriter]: ...
def register(self, name: str) -> Any: ... # TODO: ParamSpec
def reset_available_writers(self) -> None: ...
def set_dirty(self) -> None: ...
def __iter__(self) -> Iterator[MovieWriter]: ...
def __getitem__(self, name: str) -> MovieWriter: ...
@property
def avail(self) -> Dict[str, MovieWriter]: ...

8
matplotlib/artist.pyi Normal file
Просмотреть файл

@ -0,0 +1,8 @@
from typing import Any
class Artist:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,2 @@
from ._subplots import *
from ._axes import *

965
matplotlib/axes/_axes.pyi Normal file
Просмотреть файл

@ -0,0 +1,965 @@
from datetime import tzinfo
from typing import (Any, BinaryIO, Callable, ContextManager, Dict, List,
Literal, Mapping, Optional, Sequence, Tuple, Type, Union,
overload)
from matplotlib._typing import ArrayLike, Scalar, _DetrendCallable, ndarray
from matplotlib.artist import Artist
from matplotlib.axes._base import _AxesBase
from matplotlib.axes._subplots import SubplotBase
from matplotlib.backend_bases import Event, FigureManagerBase
from matplotlib.cm import Colormap, ScalarMappable
from matplotlib.collections import (BrokenBarHCollection, Collection,
EventCollection, LineCollection,
PathCollection, PolyCollection, QuadMesh)
from matplotlib.colorbar import Colorbar
from matplotlib.colors import Normalize, _ColorLike
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
from matplotlib.contour import ContourSet, QuadContourSet
from matplotlib.figure import Figure
from matplotlib.image import AxesImage, FigureImage
from matplotlib.legend import Legend
from matplotlib.lines import Line2D
from matplotlib.markers import MarkerStyle
from matplotlib.patches import FancyArrow, Polygon, Wedge
from matplotlib.quiver import Barbs, Quiver, QuiverKey
from matplotlib.streamploy import StreamplotSet
from matplotlib.table import Table
from matplotlib.text import Annotation, Text
from matplotlib.transforms import Bbox
from matplotlib.widgets import SubplotTool
from PIL.Image import Image
class Axes(_AxesBase):
# TODO: Most methods on Axes are the same as pyplot
# (as pyplot is just global functions onto a shared Axes).
# Mirror those here.
# TODO: Many of these methods are actually defined on _AxesBase.
transData: Any # TODO
transAxis: Any # TODO
def __init__(
self,
fig: Figure,
rect: Union[Bbox, Sequence[int]],
facecolor: Optional[_ColorLike] = ...,
frameon: bool = ...,
sharex: Optional[Axes] = ...,
sharey: Optional[Axes] = ...,
label: str = ...,
xscale: Optional[str] = ...,
yscale: Optional[str] = ...,
box_aspect: Optional[float] = ...,
**kwargs: Any
) -> None: ...
def acorr(self, x: ArrayLike, *, data: Optional[Any] = ..., **kwargs: Any) -> Tuple[ndarray, ndarray, Union[LineCollection, Line2D], Optional[Line2D]]: ...
add_artist: Any # TODO
add_callback: Any # TODO
add_child_axes: Any # TODO
add_collection: Any # TODO
add_container: Any # TODO
add_image: Any # TODO
add_line: Any # TODO
add_patch: Any # TODO
add_table: Any # TODO
def angle_spectrum(
self,
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
def annotate(self, s: str, xy: Tuple[float, float], *args: Any, **kwargs: Any) -> Annotation: ...
def apply_aspect(self, position: Optional[ArrayLike] = ...) -> None: ...
def arrow(self, x: float, y: float, dx: float, dy: float, **kwargs: Any) -> FancyArrow: ...
def autoscale(self, enable: Optional[bool] = ..., axis: Optional[Literal["both", "x", "y"]] = ..., tight: Optional[bool] = ...) -> None: ...
def autoscale_view(self, tight: Optional[bool] = ..., scalex: bool = ..., scaley: bool = ...) -> None: ...
def axes(self, arg: Optional[Tuple[float, float, float, float]] = ..., **kwargs: Any) -> Axes: ...
def axhline(self, y: Optional[Scalar] = ..., xmin: Optional[Scalar] = ..., xmax: Optional[Scalar] = ..., **kwargs: Any) -> Line2D: ...
def axhspan(self, ymin: float, ymax: float, xmin: Optional[int] = ..., xmax: Optional[int] = ..., **kwargs: Any) -> Polygon: ...
# TODO: write overloads for various forms
def axis(self, *args: Any, **kwargs: Any) -> Tuple[float, float, float, float]: ...
def axvline(self, x: Optional[Scalar] = ..., ymin: Optional[Scalar] = ..., ymax: Optional[Scalar] = ..., **kwargs: Any) -> Line2D: ...
def axvspan(self, xmin: Scalar, xmax: Scalar, ymin: Optional[Scalar] = ..., ymax: Optional[Scalar] = ..., **kwargs: Any) -> Polygon: ...
# Docs are misleading about this
def bar(
self,
x: Union[Scalar, ArrayLike],
height: Union[Scalar, ArrayLike],
width: Optional[Union[Scalar, ArrayLike]] = ...,
bottom: Optional[Union[Scalar, ArrayLike]] = ...,
*,
align: Literal["center", "edge"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> BarContainer: ...
# TODO: write overloads for various forms
def barbs(self, *args: Any, data: Optional[Any] = ..., **kwargs: Any) -> Barbs: ...
def bar_label(
self,
container: BarContainer,
labels: Optional[ArrayLike] = ...,
*,
fmt: str = ...,
label_type: Literal['edge', 'center'] = ...,
padding: float = ...,
**kwargs: Any
) -> List[Text]: ...
# barh is just bar, but x=left and bottom=y
def barh(
self,
y: Union[Scalar, ArrayLike],
width: Union[Scalar, ArrayLike],
height: Optional[Union[Scalar, ArrayLike]] = ...,
left: Optional[Union[Scalar, ArrayLike]] = ...,
*,
align: Literal["center", "edge"] = ...,
**kwargs: Any
) -> BarContainer: ...
def boxplot(
self,
x: Union[ArrayLike, Sequence[ArrayLike]],
notch: Optional[bool] = ...,
sym: Optional[str] = ...,
vert: Optional[bool] = ...,
whis: Optional[Union[float, ArrayLike, str]] = ...,
positions: Optional[ArrayLike] = ...,
widths: Optional[Union[Scalar, ArrayLike]] = ...,
patch_artist: Optional[bool] = ...,
bootstrap: Optional[int] = ...,
usermedians: Optional[ArrayLike] = ...,
conf_intervals: Optional[ArrayLike] = ...,
meanline: Optional[bool] = ...,
showmeans: Optional[bool] = ...,
showcaps: Optional[bool] = ...,
showbox: Optional[bool] = ...,
showfliers: Optional[bool] = ...,
boxprops: Optional[Dict[Any, Any]] = ...,
labels: Optional[Sequence[Any]] = ...,
flierprops: Optional[Any] = ...,
medianprops: Optional[Dict[Any, Any]] = ...,
meanprops: Optional[Dict[Any, Any]] = ...,
capprops: Optional[Dict[Any, Any]] = ...,
whiskerprops: Optional[Dict[Any, Any]] = ...,
manage_ticks: Optional[bool] = ...,
autorange: Optional[bool] = ...,
zorder: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...
) -> Dict[str, Line2D]: ...
def broken_barh(self, xranges: Sequence[Tuple[float, float]], yrange: Tuple[float, float], *, data: Optional[Any] = ..., **kwargs: Any) -> BrokenBarHCollection: ...
bxp: Any # TODO
can_pan: Any # TODO
can_zoom: Any # TODO
def cla(self) -> None: ...
def clabel(self, CS: ContourSet, *args: Any, **kwargs: Any) -> List[Text]: ...
def clim(self, vmin: Optional[float] = ..., vmax: Optional[float] = ...) -> None: ...
def close(self, fig: Optional[Union[int, str, Figure]] = ...) -> None: ...
def clear(self) -> None: ...
def cohere(
self,
x: ArrayLike, y: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray]: ... # ArrayLike?
contains: Any # TODO
contains_point: Any # TODO
# TODO: write overloads for various forms
def contour(self, *args: Any, data: Optional[Any] = ..., **kwargs: Any) -> QuadContourSet: ...
def contourf(self, *args: Any, data: Optional[Any] = ..., **kwargs: Any) -> QuadContourSet: ...
convert_xunits: Any # TODO
convert_yunits: Any # TODO
def csd(
self,
x: ArrayLike, y: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
return_line: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, Line2D]: ... # ArrayLike?
drag_pan: Any # TODO
def draw(self) -> None: ...
draw_artist: Any # TODO
end_pan: Any # TODO
def errorbar(
self,
x: ArrayLike, y: ArrayLike,
yerr: Optional[Union[Scalar, ArrayLike]] = ...,
xerr: Optional[Union[Scalar, ArrayLike]] = ...,
fmt: str = ...,
ecolor: Optional[_ColorLike] = ...,
elinewidth: Optional[Scalar] = ...,
capsize: Optional[Scalar] = ...,
barsabove: bool = ...,
lolims: bool = ...,
uplims: bool = ...,
xlolims: bool = ...,
xuplims: bool = ...,
errorevery: int = ...,
capthick: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> ErrorbarContainer: ...
def eventplot(
self,
positions: ArrayLike,
orientation: Optional[Literal["horizontal", "vertical"]],
lineoffsets: Optional[Union[Scalar, ArrayLike]] = ...,
linelengths: Optional[Union[Scalar, ArrayLike]] = ...,
linewidths: Optional[Union[Scalar, ArrayLike]] = ...,
colors: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ...,
linestyles: Union[str, Tuple[str, ...], Sequence[Any]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[EventCollection]: ...
# TODO: write overloads for various forms
def fill(self, *args: Any, data: Optional[Mapping[Any, Any]] = ..., **kwargs: Any) -> List[Polygon]: ...
def fill_between(
self,
x: ArrayLike, y1: ArrayLike,
y2: Union[ArrayLike, Scalar] = ...,
where: Optional[ArrayLike] = ...,
interpolate: bool = ...,
step: Optional[Literal["pre", "post", "mid"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def fill_betweenx(
self,
y: ArrayLike, x1: ArrayLike,
x2: Union[ArrayLike, Scalar] = ...,
where: Optional[ArrayLike] = ...,
interpolate: bool = ...,
step: Optional[Literal["pre", "post", "mid"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def findobj(
self,
o: Optional[Any] = ...,
match: Optional[Union[
Callable[[Artist], bool],
Line2D,
]] = ...,
include_self: bool = ...
) -> List[Artist]: ...
get_adjustable: Any # TODO
get_agg_filter: Any # TODO
get_alpha: Any # TODO
get_anchor: Any # TODO
get_animated: Any # TODO
get_aspect: Any # TODO
get_autoscale_on: Any # TODO
get_autoscalex_on: Any # TODO
get_autoscaley_on: Any # TODO
get_axes_locator: Any # TODO
get_axisbelow: Any # TODO
get_box_aspect: Any # TODO
get_children: Any # TODO
get_clip_box: Any # TODO
get_clip_on: Any # TODO
get_clip_path: Any # TODO
get_contains: Any # TODO
get_cursor_data: Any # TODO
get_data_ratio: Any # TODO
get_default_bbox_extra_artists: Any # TODO
get_facecolor: Any # TODO
get_fc: Any # TODO
get_figure: Any # TODO
get_frame_on: Any # TODO
get_gid: Any # TODO
get_images: Any # TODO
get_in_layout: Any # TODO
get_label: Any # TODO
get_legend: Any # TODO
get_legend_handles_labels: Any # TODO
get_lines: Any # TODO
get_navigate: Any # TODO
get_navigate_mode: Any # TODO
get_path_effects: Any # TODO
get_picker: Any # TODO
get_position: Any # TODO
get_rasterization_zorder: Any # TODO
get_rasterized: Any # TODO
get_renderer_cache: Any # TODO
get_shared_x_axes: Any # TODO
get_shared_y_axes: Any # TODO
get_sketch_params: Any # TODO
get_snap: Any # TODO
get_tightbbox: Any # TODO
get_title: Any # TODO
get_transform: Any # TODO
get_transformed_clip_path_and_affine: Any # TODO
get_url: Any # TODO
get_visible: Any # TODO
get_window_extent: Any # TODO
get_xaxis: Any # TODO
get_xaxis_text1_transform: Any # TODO
get_xaxis_text2_transform: Any # TODO
get_xaxis_transform: Any # TODO
get_xbound: Any # TODO
get_xgridlines: Any # TODO
get_xlabel: Any # TODO
get_xlim: Any # TODO
get_xmajorticklabels: Any # TODO
get_xminorticklabels: Any # TODO
get_xscale: Any # TODO
get_xticklabels: Any # TODO
get_xticklines: Any # TODO
get_xticks: Any # TODO
get_yaxis: Any # TODO
get_yaxis_text1_transform: Any # TODO
get_yaxis_text2_transform: Any # TODO
get_yaxis_transform: Any # TODO
get_ybound: Any # TODO
get_ygridlines: Any # TODO
get_ylabel: Any # TODO
get_ylim: Any # TODO
get_ymajorticklabels: Any # TODO
get_yminorticklabels: Any # TODO
get_yscale: Any # TODO
get_yticklabels: Any # TODO
get_yticklines: Any # TODO
get_yticks: Any # TODO
get_zorder: Any # TODO
def grid(self, b: Optional[bool] = ..., which: Literal["major", "minor", "both"] = ..., axis: Literal["both", "x", "y"] = ..., **kwargs: Any): ...
has_data: Any # TODO
have_units: Any # TODO
def hexbin(
self
x: ArrayLike, y: ArrayLike,
C: Optional[ArrayLike] = ...,
gridsize: Union[int, Tuple[int, int]] = ...,
bins: Optional[Union[Literal["log"], int, Sequence[Any]]] = ...,
xscale: Literal["linear", "log"] = ...,
yscale: Literal["linear", "log"] = ...,
extent: Optional[float] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
vmin: Optional[float] = ...,
vmax: Optional[float] = ...,
alpha: Optional[float] = ...,
linewidths: Optional[float] = ...,
edgecolors: Optional[Union[Literal["face", "none"], _ColorLike]] = ...,
reduce_C_function: Callable[[ArrayLike], float] = ...,
mincnt: Optional[int] = ...,
marginals: bool = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def hist(
self,
x: Union[ArrayLike, Sequence[ArrayLike]],
bins: Optional[Union[int, str, Sequence[Any]]],
range: Optional[Tuple] = ...,
density: Optional[bool] = ...,
weights: Optional[ArrayLike] = ...,
cumulative: bool = ...,
bottom: Optional[Union[ArrayLike, Scalar]] = ...,
histtype: Literal["bar", "barstacked", "step", "stepfilled"] = ...,
align: Literal["left", "mid", "right"] = ...,
orientation: Literal["vertical", "horizontal"] = ...,
rwidth: Optional[Scalar] = ...,
log: bool = ...,
color: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ...,
label: Optional[str] = ...,
stacked: bool = ...,
normed: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[Union[ArrayLike, List[ArrayLike]], ArrayLike, Union[List[Any], List[List[Any]]]]: ...
def hist2d(
self,
x: ArrayLike, y: ArrayLike,
bins: Optional[Union[
int,
Tuple[int, int],
ArrayLike,
Tuple[ArrayLike, ArrayLike],
]] = ...,
range: Optional[ArrayLike] = ...,
density: bool = ...,
weights: Optional[ArrayLike] = ...,
cmin: Optional[Scalar] = ...,
cmax: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, ArrayLike, QuadMesh]: ...
def hlines(
self,
y: Union[Scalar, ArrayLike],
xmin: Union[Scalar, ArrayLike],
xmax: Union[Scalar, ArrayLike],
colors: _ColorLike = ...,
linestyles: Literal['solid', 'dashed', 'dashdot', 'dotted'] = ...,
label: str = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> LineCollection: ...
def imshow(
self,
X: Union[ArrayLike, Image],
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
aspect: Optional[Union[Literal["equal", "auto"], float]] = ...,
interpolation: Optional[str] = ...,
alpha: Optional[Scalar] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
origin: Optional[Literal["upper", "lower"]] = ...,
extent: Optional[Tuple[Scalar, Scalar, Scalar, Scalar]] = ...,
shape: Any = ..., # deprecated
filternorm: bool = ...,
filterrad: float = ...,
imlim: Any = ..., # deprecated
resample: Optional[bool] = ...,
url: Optional[str] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> AxesImage: ...
imshow: Any # TODO
in_axes: Any # TODO
indicate_inset: Any # TODO
indicate_inset_zoom: Any # TODO
inset_axes: Any # TODO
invert_xaxis: Any # TODO
invert_yaxis: Any # TODO
is_transform_set: Any # TODO
# TODO: write overloads for various forms
def legend(self, *args: Any, **kwargs: Any) -> Legend: ...
def locator_params(self, axis: Optional[Literal["both", "x", "y"]] = ..., tight: Optional[bool] = ..., **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def loglog(self, *args: Any, **kwargs: Any) -> List[Line2D]: ...
def magnitude_spectrum(
self,
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
scale: Optional[Literal["default", "linear", "dB"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
def margins(self, *margins: float, x: Optional[float] = ..., y: Optional[float] = ..., tight: Optional[bool] = ...) -> Tuple[float, float]: ...
def matshow(self, A: ArrayLike, fignum: Optional[Union[int, Literal[False]]] = None, **kwargs: Any) -> AxesImage: ...
def minorticks_off(self) -> None: ...
def minorticks_on(self) -> None: ...
mouseover: Any # TODO
name: Any # TODO
pchanged: Any # TODO
# TODO: write overloads for various forms
def pcolor(
self,
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> Collection: ...
pcolorfast: Any # TODO
# TODO: write overloads for various forms
def pcolormesh(
self,
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
shading: Literal["flat", "gouraud"] = ...,
antialiased: Union[bool, Sequence[bool]] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> QuadMesh: ...
def phase_spectrum(
self,
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
pick: Any # TODO
pickable: Any # TODO
def pie(
self,
x: ArrayLike,
explode: Optional[ArrayLike]= ...,
labels: Optional[Sequence[str]] = ...,
colors: Optional[Sequence[_ColorLike]] = ...,
autopct: Optional[Union[str, Callable[..., str]]] = ...,
pctdistance: float = ...,
shadow: bool = ...,
labeldistance: Optional[float] = ...,
startangle: Optional[float] = ...,
radius: Optional[float] = ...,
counterclock: bool = ...,
wedgeprops: Optional[Dict[Any, Any]] = ...,
textprops: Optional[Dict[Any, Any]] = ...,
center: Sequence[float] = ...,
frame: bool = ...,
rotatelabels: bool = ...,
*,
data: Optional[Any] = ...,
) -> Tuple[List[Wedge], List[Text], List[Text]]: ...
# TODO: write overloads for various forms
def plot(self, *args: Any, scalex: bool = ..., scaley: bool = ..., data: Optional[Any] = ..., **kwargs: Any) -> List[Line2D]: ...
def plot_date(
self,
x: ArrayLike,
y: ArrayLike,
fmt: str = ...,
tz: Optional[Union[str, tzinfo]] = ...,
xdate: bool = ...,
ydate: bool = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[Line2D]: ...
properties: Any # TODO
def psd(
self,
x: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
return_line: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
# TODO: write overloads for various forms
def quiver(self, *args: Any, data: Optional[Any] = ..., **kw: Any) -> Quiver: ...
def quiverkey(self, Q: Quiver, X: float, Y: float, U: float, label: str, **kw: Any) -> QuiverKey: ...
redraw_in_frame: Any # TODO
relim: Any # TODO
remove: Any # TODO
remove_callback: Any # TODO
reset_position: Any # TODO
def scatter(
self,
x: ArrayLike,
y: ArrayLike,
s: Optional[Union[Scalar, ArrayLike]] = ...,
c: Optional[Union[_ColorLike, Sequence[float], Sequence[_ColorLike]]] = ...,
marker: Optional[MarkerStyle] = ...,
cmap: Optional[Colormap] = ...,
norm: Optional[Normalize] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
alpha: Optional[Scalar] = ...,
linewidths: Optional[Union[Scalar, ArrayLike]] = ...,
verts: Optional[Any] = ..., # not documented?
edgecolors: Optional[Union[Literal["face", "none"], _ColorLike, Sequence[_ColorLike]]] = ...,
*,
plotnonfinite: bool = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> PathCollection: ...
secondary_xaxis: Any # TODO
secondary_yaxis: Any # TODO
# TODO: write overloads for various forms (below is a try at it)
def semilogx(self, *args: Any, **kwargs: Any) -> List[Line2D]: ...
# TODO: write overloads for various forms (below is a try at it)
def semilogy(self, *args: Any, **kwargs: Any) -> List[Line2D]: ...
set: Any # TODO
set_adjustable: Any # TODO
set_agg_filter: Any # TODO
set_alpha: Any # TODO
set_anchor: Any # TODO
set_animated: Any # TODO
set_aspect: Any # TODO
set_autoscale_on: Any # TODO
set_autoscalex_on: Any # TODO
set_autoscaley_on: Any # TODO
set_axes_locator: Any # TODO
set_axis_off: Any # TODO
set_axis_on: Any # TODO
set_axisbelow: Any # TODO
set_box_aspect: Any # TODO
set_clip_box: Any # TODO
set_clip_on: Any # TODO
set_clip_path: Any # TODO
set_contains: Any # TODO
set_facecolor: Any # TODO
set_fc: Any # TODO
set_figure: Any # TODO
set_frame_on: Any # TODO
set_gid: Any # TODO
set_in_layout: Any # TODO
set_label: Any # TODO
set_navigate: Any # TODO
set_navigate_mode: Any # TODO
set_path_effects: Any # TODO
set_picker: Any # TODO
set_position: Any # TODO
set_prop_cycle: Any # TODO
set_rasterization_zorder: Any # TODO
set_rasterized: Any # TODO
set_sketch_params: Any # TODO
set_snap: Any # TODO
set_title: Any # TODO
set_transform: Any # TODO
set_url: Any # TODO
set_visible: Any # TODO
set_xbound: Any # TODO
set_xlabel: Any # TODO
set_xlim: Any # TODO
set_xmargin: Any # TODO
set_xscale: Any # TODO
set_xticklabels: Any # TODO
set_xticks: Any # TODO
set_ybound: Any # TODO
set_ylabel: Any # TODO
set_ylim: Any # TODO
set_ymargin: Any # TODO
set_yscale: Any # TODO
set_yticklabels: Any # TODO
set_yticks: Any # TODO
set_zorder: Any # TODO
sharex: Any # TODO
sharey: Any # TODO
def specgram(
self,
x: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
cmap: Optional[Colormap] = ...,
xextent: Optional[Tuple[float, float]] = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
mode: Optional[Literal["default", "psd", "magnitude", "angle", "phase"]] = ...,
scale: Optional[Literal["default", "linear", "dB"]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, ndarray, AxesImage]: ...
def spy(
self,
Z: ArrayLike,
precision: Union[float, Literal["present"]] = ...,
marker: Optional[Any] = ..., # TODO
markersize: Optional[float] = ...,
aspect: Optional[Union[Literal["equal", "auto"], float]] = ...,
origin: Literal["upper", "lower"] = ...,
**kwargs: Any
) -> Union[AxesImage, Line2D]: ...
def stackplot(
self,
x: ArrayLike,
*args: ArrayLike,
labels: Sequence[str] = ...,
colors: Optional[Sequence[_ColorLike]] = ...,
baseline: Literal["zero", "sym", "wiggle", "weighted_wiggle"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[PolyCollection]: ...
stairs: Any # TODO
stale: Any # TODO
start_pan: Any # TODO
# TODO: write overloads for various forms
def stem(
self,
*args: ArrayLike,
linefmt: Optional[str] = ...,
markerfmt: Optional[str] = ...,
basefmt: Optional[str] = ...,
bottom: float = ...,
label: Optional[str] = ...,
use_line_collection: bool = ...,
data: Optional[Any] = ...
) -> StemContainer: ...
# TODO: write overloads for various forms
def step(
self,
x: ArrayLike,
y: ArrayLike,
*args: Any,
where: Literal["pre", "post", "mid"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[Line2D]: ...
sticky_edges: Any # TODO
def streamplot(
self,
x: ArrayLike,
y: ArrayLike,
u: ArrayLike,
v: ArrayLike,
density: Union[float, Tuple[float, float]] = ...,
linewidth: Optional[Union[float, ArrayLike]] = ...,
color: Optional[Union[_ColorLike, ArrayLike]] = ...,
cmap: Optional[Colormap] = ...,
norm: Optional[Normalize] = ...,
arrowsize: float = ...,
arrowstyle: str = ...,
minlength: float = ...,
transform: Optional[Any] = ..., # TODO: what is this?
zorder: Optional[int] = ...,
start_points: Optional[ArrayLike] = ...,
maxlength: float = ...,
integration_direction: Literal["forward", "backward", "both"] = ...,
*,
data: Optional[Any] = ...,
) -> StreamplotSet: ... # TODO: does this type exist?
# TODO: resolve list vs sequence
def table(
self,
cellText: Optional[Sequence[Sequence[str]]] = ...,
cellColours: Optional[Sequence[Sequence[_ColorLike]]] = ...,
cellLoc: Literal["left", "center", "right"] = ...,
colWidths: Optional[Sequence[float]] = ...,
rowLabels: Literal["left", "center", "right"] = ...,
rowColours: Literal["left", "center", "right"] = ...,
rowLoc: Literal["left", "center", "right"] = ...,
colLabels: Literal["left", "center", "right"] = ...,
colColours: Literal["left", "center", "right"] = ...,
colLoc: Literal["left", "center", "right"] = ...,
loc: str = ...,
bbox: Optional[Bbox] = ...,
edges: str = ..., # TODO: be more exact
**kwargs: Any
) -> Table: ...
def text(self, x: Scalar, y: Scalar, s: str, fontdict: Dict[Any, Any] = ..., withdash: Any = ..., **kwargs: Any) -> Text: ...
def tick_params(self, axis: Literal["x", "y", "both"] = ..., **kwargs: Any) -> None: ...
def ticklabel_format(
self,
*,
axis: Literal["x", "y", "both"] = ...,
style: str = ...,
scilimits: Optional[Tuple[int, int]] = ...,
useOffset: Optional[Union[bool, int]] = ...,
useLocale: Optional[bool] = ...,
useMathText: Optional[bool] = ...,
) -> None: ...
# TODO: write overloads for various forms
def tricontour(self, *args: Any, **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def tricontourf(self, *args: Any, **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def tripcolor(
self,
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
shading: Literal["flat", "gouraud"] = ...,
facecolors: Optional[_ColorLike] = ..., # TODO: not sure if this is correct, the option is undocumented
**kwargs: Any
) -> None: ...
# TODO: write overloads for various forms
def triplot(self, *args: Any, **kwargs: Any) -> List[Line2D]: ...
def twinx(self, ax: Optional[Axes] = ...) -> Axes: ...
def twiny(self, ax: Optional[Axes] = ...) -> Axes: ...
update: Any # TODO
update_datalim: Any # TODO
update_datalim_bounds: Any # TODO
update_from: Any # TODO
use_sticky_edges: Any # TODO
viewLim: Any # TODO
violin: Any # TODO
def violinplot(
self,
dataset: ArrayLike,
positions: Optional[ArrayLike] = ...,
vert: bool = ...,
widths: ArrayLike = ..., # Default is 0.5, which is "array-like" even though it's a scalar.
showmeans: bool = ...,
showextrema: bool = ...,
showmedians: bool = ...,
points: Scalar = ...,
bw_method: Optional[Union[Literal["scott", "silverman"], Scalar, Callable]] = ...,
*,
data: Optional[Any] = ...,
) -> Dict[str, Any]: ... # TODO: TypedDict for this
def vlines(
self,
x: Union[Scalar, ArrayLike],
ymin: Union[Scalar, ArrayLike],
ymax: Union[Scalar, ArrayLike],
colors: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ..., # TODO: This may not be the right type for colors
linestyles: Optional[Literal["solid", "dashed", "dashdot", "dotted"]] = ...,
label: str = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> LineCollection: ...
xaxis_date: Any # TODO
xaxis_inverted: Any # TODO
def xcorr(
self,
x: ArrayLike,
y: ArrayLike,
normed: bool = ...,
detrend: _DetrendCallable = ...,
usevlines: bool = ...,
maxlags: int = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, Union[LineCollection, Line2D], Optional[Line2D]]: ...
yaxis_date: Any # TODO
yaxis_inverted: Any # TODO
zorder: Any # TODO
def __getattr__(self, name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,8 @@
from typing import Any
class _AxesBase:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,11 @@
from typing import Any
from matplotlib.figure import Figure
class SubplotBase:
# TODO: write overloads for various forms
def __init__(self, fig: Figure, *args: Any, **kwargs: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

133
matplotlib/axis.pyi Normal file
Просмотреть файл

@ -0,0 +1,133 @@
from datetime import tzinfo
from typing import Any, Dict, Iterable, List, Literal, Optional, Union
from matplotlib._typing import ndarray
from matplotlib.artist import Artist
from matplotlib.axes import Axes
from matplotlib.cbook import CallbackRegistry
from matplotlib.lines import Line2D
from matplotlib.text import Text
from matplotlib.ticker import Formatter, Locator
from matplotlib.transforms import Transform
class Axis(Artist):
isDefault_label: bool
axes: Axes
major: Ticker
minor: Ticker
callbacks: CallbackRegistry
label: Text
labelpad: float
offsetText: Text
pickradius: float
majorTicks: List[Tick]
minorTicks: List[Tick]
def __init__(self, axes: Axes, pickradius: float = ...) -> None: ...
def get_remove_overlapping_locs(self) -> bool: ...
def set_remove_overlapping_locs(self, val: Any) -> None: ...
@property
def remove_overlapping_locs(self) -> bool: ...
@remove_overlapping_locs.setter
def remove_overlapping_locs(self, val: Any) -> None: ...
def set_label_coords(self, x: float, y: float, transform: Optional[Transform] = ...) -> None: ...
def get_transform(self) -> Transform: ...
def get_scale(self) -> str: ...
def limit_range_for_scale(self, vmin, vmax): ...
def get_children(self) -> List[Artist]: ...
def clear(self) -> None: ...
def cla(self) -> None: ...
def reset_ticks(self) -> None: ...
def set_tick_params(self, which='major', reset=..., **kw: Any): ...
def set_clip_path(self, clippath, transform=...): ...
def get_view_interval(self): ...
def set_view_interval(self, vmin, vmax, ignore=...): ...
def get_data_interval(self): ...
def set_data_interval(self, vmin, vmax, ignore=...): ...
def get_inverted(self): ...
def set_inverted(self, inverted): ...
def set_default_intervals(self): ...
def get_ticklabel_extents(self, renderer): ...
def get_tightbbox(self, renderer, *, for_layout_only=...): ...
def get_tick_padding(self): ...
def draw(self, renderer, *args: Any, **kwargs: Any): ...
def get_gridlines(self): ...
def get_label(self) -> Text: ...
def get_offset_text(self) -> Text: ...
def get_pickradius(self) -> float: ...
def get_majorticklabels(self) -> List[Text]: ...
def get_minorticklabels(self) -> List[Text]: ...
def get_ticklabels(self, minor: bool = ..., which: Optional[Literal['minor', 'major', 'both']] = ...) -> List[Text]: ...
def get_majorticklines(self) -> List[Line2D]: ...
def get_minorticklines(self) -> List[Line2D]: ...
def get_ticklines(self, minor: bool = ...) -> List[Line2D]: ...
def get_majorticklocs(self): ...
def get_minorticklocs(self): ...
def get_ticklocs(self, minor=...): ...
def get_ticks_direction(self, minor: bool = ...) -> ndarray: ...
def get_label_text(self): ...
def get_major_locator(self): ...
def get_minor_locator(self): ...
def get_major_formatter(self): ...
def get_minor_formatter(self): ...
def get_major_ticks(self, numticks=...): ...
def get_minor_ticks(self, numticks=...): ...
def grid(self, b=..., which=..., **kwargs: Any): ...
def update_units(self, data): ...
def have_units(self) -> bool: ...
def convert_units(self, x): ...
def set_units(self, u): ...
def get_units(self): ...
def set_label_text(self, label: str, fontdict: Optional[Dict[str, Any]], **kwargs: Any): ...
def set_major_formatter(self, formatter: Formatter) -> None: ...
def set_minor_formatter(self, formatter: Formatter) -> None: ...
def set_major_locator(self, locator: Locator) -> None: ...
def set_minor_locator(self, locator: Locator) -> None: ...
def set_pickradius(self, pickradius: float) -> None: ...
def set_ticklabels(self, ticklabels: Iterable[Union[str, Text]], *, minor: bool = ..., **kwargs: Any) -> None: ...
def set_ticks(self, ticks: Iterable[float], *, minor: bool = ...) -> None: ...
def pan(self, numsteps) -> None: ...
def zoom(self, direction) -> None: ...
def axis_date(self, tz: Optional[Union[str, tzinfo]]) -> None: ...
def get_tick_space(self): ...
def get_label_position(self): ...
def set_label_position(self, position: Literal['top', 'bottom']): ...
def get_minpos(self): ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class XAxis(Axis):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class YAxis(Axis):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class Ticker:
def __init__(self) -> None: ...
@property
def locator(self) -> Locator: ...
@locator.setter
def locator(self, locator: Locator) -> None: ...
@property
def formatter(self) -> Formatter: ...
@formatter.setter
def formatter(self, formatter: Formatter) -> None: ...
class Tick(Artist):
def __getattr__(self, name: str) -> Any: ... # incomplete
class XTick(Tick):
def __getattr__(self, name: str) -> Any: ... # incomplete
class YTick(Tick):
def __getattr__(self, name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,19 @@
from typing import Any
class Event:
def __getattr__(self, name: str) -> Any: ... # incomplete
class LocationEvent(Event):
def __getattr__(self, name: str) -> Any: ... # incomplete
class MouseEvent(LocationEvent):
def __getattr__(self, name: str) -> Any: ... # incomplete
class FigureManagerBase:
def __getattr__(self, name: str) -> Any: ... # incomplete
class RendererBase:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/bezier.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/category.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,132 @@
# COMPLETE
from os import PathLike
from typing import (IO, Any, Callable, ContextManager, Dict, Generator,
Generic, ItemsView, Iterable, Iterator, KeysView, List,
Literal, Mapping, Optional, Sequence, Tuple, Type, TypeVar,
Union, ValuesView, overload)
from _typeshed import AnyPath, SupportsWrite
from matplotlib._typing import ArrayLike, ndarray
from matplotlib.artist import Artist
_T = TypeVar("_T")
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")
_KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
class CallbackRegistry:
def __init__(self, exception_handler: Optional[Callable[[Exception], Any]] = ...) -> None: ...
def connect(self, signal: Any, func: Callable[..., Any]) -> int: ...
def disconnect(self, cid: int) -> None: ...
def process(self, s: Any, *args: Any, **kwargs: Any) -> None: ...
class Grouper:
def __init__(self, init: Iterable[Any] = ...) -> None: ...
def clean(self) -> None: ...
def get_siblings(self, a: Any) -> List[Any]: ...
def join(self, a: Any, *args: Any) -> None: ...
def joined(self, a: Any, b: Any) -> bool: ...
def remove(self, a: Any) -> None: ...
def __contains__(self, item: Any) -> bool: ...
def __iter__(self) -> Iterator[Any]: ...
class IgnoredKeyboardWarning(UserWarning): ...
class Stack:
def __init__(self, default: Optional[Any] = ...) -> None: ...
def back(self) -> Stack: ...
def bubble(self, o: Any) -> Any: ...
def clear(self) -> None: ...
def empty(self) -> bool: ...
def forward(self) -> Any: ...
def home(self) -> Any: ...
def push(self, o: Any) -> Any: ...
def remove(self, o: Any) -> None: ...
def boxplot_stats(
x: ArrayLike,
whis: Union[float, Tuple[float, float]] = ...,
bootstrap: Optional[int] = ...,
labels: Optional[ArrayLike] = ...,
autorange: bool = ...
) -> List[Dict[str, Any]]: ...
def contiguous_regions(mask: ArrayLike) -> List[Tuple[int, int]]: ...
def delete_masked_points(*args: Any) -> Sequence[Any]: ...
def file_requires_unicode(x: SupportsWrite[Any]) -> bool: ...
def flatten(seq: Iterable[Any], scalarp: Callable[[Any], Any] = ...) -> Generator[Any, Any, Any]: ...
def get_sample_data(fname: AnyPath, asfileobj: bool = ..., *, np_load: bool = ...) -> Any: ... # TODO: split into overloads
def index_of(y: Union[float, ArrayLike]) -> Tuple[ndarray, ndarray]: ...
def is_math_text(s: object) -> bool: ...
def is_scalar_or_string(val: object) -> bool: ...
def is_writable_file_like(val: object) -> bool: ...
ls_mapper: Dict[str, str]
ls_mapper_r: Dict[str, str]
class maxdict(Dict[_KT, _VT]):
def __init__(self, maxsize: int) -> None: ...
def normalize_kwargs(
kw: Optional[Mapping[str, Any]],
alias_mapping: Optional[Union[Mapping[str, Iterable[Any]], Type[Artist]]] = ...,
require: Sequence[str] = ...,
forbidden: Sequence[str] = ...,
allowed: Optional[ Sequence[str]] = ...
) -> Dict[str, Any]: ... # TODO: mappings between what and what?
def open_file_cm(path_or_file: Union[str, PathLike[Any], IO[Any]], mode: str = ..., encoding: Optional[str] = ...) -> ContextManager[IO[Any]]: ...
def print_cycles(objects: Iterable[Any], outstream: SupportsWrite[str] = ..., show_progress: bool = ...) -> None: ...
def pts_to_midstep(x: ArrayLike, *args: ArrayLike) -> ndarray: ...
def pts_to_poststep(x: ArrayLike, *args: ArrayLike) -> ndarray: ...
def pts_to_prestep(x: ArrayLike, *args: ArrayLike) -> ndarray: ...
def report_memory(i: int = ...) -> int: ...
def safe_first_element(obj: Union[Iterable[_T], Iterator[_T]]) -> _T: ...
def safe_masked_invalid(x: ArrayLike, copy: bool = ...) -> ndarray: ...
@overload
def sanitize_sequence(data: ItemsView[_KT_co, _VT_co]) -> List[Tuple[_KT_co, _VT_co]]: ...
@overload
def sanitize_sequence(data: KeysView[_KT_co]) -> List[_KT_co]: ...
@overload
def sanitize_sequence(data: ValuesView[_VT_co]) -> List[_VT_co]: ...
@overload
def sanitize_sequence(data: _T) -> _T: ...
_type = type
class silent_list(list[_T], Generic[_T]):
type: _type
def __init__(self, type: _type, seq: Optional[Iterable[_T]] = ...) -> None: ...
def simple_linear_interpolation(a: ndarray, steps: int) -> ndarray: ...
def strip_math(s: str) -> str: ...
@overload
def to_filehandle(fname: Union[str, PathLike[Any], IO[Any]], flag: str = ..., return_opened: Literal[False] = ..., encoding: Optional[str] = ...) -> IO[Any]: ...
@overload
def to_filehandle(fname: Union[str, PathLike[Any], IO[Any]], flag: str = ..., return_opened: Literal[True] = ..., encoding: Optional[str] = ...) -> Tuple[IO[Any], bool]: ...
def violin_stats(X: ArrayLike, method: Callable[[Any, ndarray], Any], points: int = ..., quantiles: Optional[ArrayLike] = ...) -> List[Dict[str, Any]]: ...

44
matplotlib/cm.pyi Normal file
Просмотреть файл

@ -0,0 +1,44 @@
# COMPLETE
from typing import Any, Optional, Tuple, Union
from matplotlib._typing import ArrayLike, ndarray
from matplotlib.colorbar import Colorbar
from matplotlib.colors import Colormap, Normalize
class ScalarMappable:
colorbar: Optional[Colorbar]
def __init__(self, norm: Optional[Normalize] = ..., cmap: Optional[Union[str, Colormap]] = ...) -> None: ...
def autoscale(self) -> None: ...
def autoscale_None(self) -> None: ...
def changed(self) -> None: ...
def get_alpha(self) -> float: ...
def get_array(self) -> ndarray: ...
def set_array(self, A: ndarray) -> None: ...
def get_clim(self) -> Tuple[float, float]: ...
def set_clim(self, vmin: Optional[float] = ..., vmax: Optional[float] = ...) -> None: ...
def get_cmap(self) -> Colormap: ...
def set_cmap(self, cmap: Optional[Union[str, Colormap]]) -> None: ...
def set_norm(self, norm: Optional[Normalize]) -> None: ...
def to_rgba(self, x: ArrayLike, alpha: Optional[float] = ..., bytes: bool = ..., norm: bool = ...) -> ndarray: ...
def add_checkler(self, checker: Any) -> None: ... # deprecated
def check_update(self, checker: Any) -> None: ... # deprecated
def get_cmap(name: Optional[Union[Colormap, str]] = ..., lut: Optional[int] = ...) -> Colormap: ...
def register_cmap(name: Optional[str] = ..., cmap: Optional[Colormap] = ..., data: Any = ..., lut: Optional[int] = ...) -> None: ...
def revcmap(data: Any) -> Any: ... # deprecated

Просмотреть файл

@ -0,0 +1,32 @@
from typing import Any
from matplotlib.artist import Artist
from matplotlib.cm import ScalarMappable
class Collection(Artist, ScalarMappable):
def __getattr__(self, name: str) -> Any: ... # incomplete
class _CollectionWithSizes(Collection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class LineCollection(Collection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class PolyCollection(_CollectionWithSizes):
def __getattr__(self, name: str) -> Any: ... # incomplete
class BrokenBarHCollection(PolyCollection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class EventCollection(LineCollection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class QuadMesh(Collection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class PathCollection(_CollectionWithSizes):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

11
matplotlib/colorbar.pyi Normal file
Просмотреть файл

@ -0,0 +1,11 @@
from typing import Any
class ColorbarBase:
def __getattr__(self, name: str) -> Any: ... # incomplete
class Colorbar(ColorbarBase):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

180
matplotlib/colors.pyi Normal file
Просмотреть файл

@ -0,0 +1,180 @@
# COMPLETE
from typing import Any, Callable, Dict, Literal, Mapping, NoReturn, Optional, Pattern, Protocol, Sequence, Tuple, TypeVar, Union, overload
from numpy.ma import MaskedArray
from matplotlib._typing import ArrayLike, Scalar, ndarray
_ColorLike = Union[
str,
Tuple[float, float, float],
Tuple[float, float, float, float],
]
_C = TypeVar("_C", bound=Colormap)
class Colormap:
colorbar_extend: bool
def __init__(self, name: str, N: int = ...) -> None: ...
@overload
def __call__(self, X: Scalar, alpha: Optional[float] = ..., bytes: bool = ...) -> Tuple[int, ...]: ... # TOOD: int or float?
@overload
def __call__(self, X: ArrayLike, alpha: Optional[float] = ..., bytes: bool = ...) -> ndarray: ...
def is_gray(self) -> bool: ...
def reversed(self: _C, name: Optional[str] = ...) -> _C: ...
def set_bad(self, color: _ColorLike = ..., alpha: Optional[float] = ...) -> None: ...
def set_over(self, color: _ColorLike = ..., alpha: Optional[float] = ...) -> None: ...
def set_under(self, color: _ColorLike = ..., alpha: Optional[float] = ...) -> None: ...
class LinearSegmentedColormap(Colormap):
def __init__(self, name: str, segmentdata: Mapping[str, Sequence[Tuple[float, float, float]]], N: int = ..., gamma: float = ...) -> None: ...
@staticmethod
def from_list(name: str, colors: ArrayLike, N: int = ..., gamma: float = ...) -> LinearSegmentedColormap: ...
def set_gamma(self, gamma: float) -> None: ...
class ListedColormap(Colormap):
# TODO: without N, colors must be len()-able
def __init__(self, colors: Union[Sequence[_ColorLike], ArrayLike], name: str = ..., N: Optional[int] = ...) -> None: ...
class Normalize:
def __init__(self, vmin: Optional[float] = ..., vmax: Optional[float] = ..., clip: bool = ...) -> None: ...
@overload
def __call__(self, value: Scalar, clip: Optional[bool] = ...) -> Scalar: ...
@overload
def __call__(self, value: ArrayLike, clip: Optional[bool] = ...) -> ndarray: ...
# See np.asanyarray input type
def autoscale(self, A: object) -> None: ...
def autoscale_None(self, A: object) -> None: ...
def inverse(self, value: ArrayLike) -> ndarray: ...
@staticmethod
def process_value(value: Union[Scalar, ArrayLike]) -> Tuple[MaskedArray, bool]: ...
def scaled(self) -> bool: ...
class TwoSlopeNorm(Normalize):
def __init__(self, vcenter: float, vmin: Optional[float] = ..., vmax: Optional[float] = ...) -> None: ...
class DivergingNorm(TwoSlopeNorm): ...
class LogNorm(Normalize): ...
class SymLogNorm(Normalize):
def __init__(self, linthresh: float, linscale: float = ..., vmin: Optional[float] = ..., vmax: Optional[float] = ..., clip: bool = ..., *, base: Optional[float] = ...) -> None: ...
class PowerNorm(Normalize):
def __init__(self, gamma: float, vmin: Optional[float] = ..., vmax: Optional[float] = ..., clip: bool = ...) -> None: ...
class BoundaryNorm(Normalize):
def __init__(self, boundaries: ArrayLike, ncolors: int, clip: bool = ..., *, extend: Literal['neither', 'both', 'min', 'max'] = ...) -> None: ...
def inverse(self, value: Any) -> NoReturn: ... # Always raises.
class NoNorm(Normalize): ...
class _BlendModeFunc(Protocol):
def __call__(self, rgb: ArrayLike, illum: ArrayLike, **kwargs: Any) -> ndarray: ...
class LightSource:
def __init__(
self,
azdeg: float = ...,
altdeg: float = ...,
hsv_min_val: float = ...,
hsv_max_val: float = ...,
hsv_min_sat: float = ...,
hsv_max_sat: float = ...
) -> None: ...
@property
def direction(self) -> ndarray: ...
def blend_hsv(
self,
rgb: ndarray,
intensity: ndarray,
hsv_max_sat: Optional[float] = ...,
hsv_max_val: Optional[float] = ...,
hsv_min_val: Optional[float] = ...,
hsv_min_sat: Optional[float] = ...
) -> ndarray: ...
def blend_overlay(self, rgb: ndarray, intensity: ndarray) -> ndarray: ...
def blend_soft_light(self, rgb: ndarray, intensity: ndarray) -> ndarray: ...
def hillshade(self, elevation: ArrayLike, vert_exag: float = ..., dx: float = ..., dy: float = ..., fraction: float = ...) -> ndarray: ...
def shade(
self,
data: ArrayLike,
cmap: Colormap,
norm: Optional[Normalize] = ...,
blend_mode: Union[Literal['hsv', 'overlay', 'soft'], _BlendModeFunc] = ...,
vmin: Optional[float] = ...,
vmax: Optional[float] = ...,
vert_exag: float = ...,
dx: float = ...,
dy: float = ...,
fraction: float = ...,
**kwargs: Any
) -> ndarray: ...
def shade_normals(self, normals: ndarray, fraction: float = ...) -> ndarray: ...
def shade_rgb(
self,
rgb: ArrayLike,
elevation: ArrayLike,
fraction: float = ...,
blend_mode: Union[Literal['hsv', 'overlay', 'soft'], _BlendModeFunc] = ...,
vert_exag: float = ...,
dx: float = ...,
dy: float = ...,
**kwargs: Any
) -> ndarray: ...
def from_levels_and_colors(
levels: ArrayLike,
colors: Sequence[_ColorLike],
extend: Literal['neither', 'min', 'max', 'both'] = ...
) -> Tuple[Colormap, Normalize]: ...
def hsv_to_rgb(hsv: ArrayLike) -> ndarray: ...
def rgb_to_hsv(arr: ArrayLike) -> ndarray: ...
def to_hex(c: Union[_ColorLike, MaskedArray], keep_alpha: bool = ...) -> str: ...
def to_rgb(c: Union[_ColorLike, MaskedArray]) -> Tuple[float, float, float]: ...
def to_rgba(c: Union[_ColorLike, MaskedArray], alpha: Optional[float] = ...) -> Tuple[float, float, float, float]: ...
def to_rgba_array(c: Any, alpha: Optional[float] = ...) -> ndarray: ...
def is_color_like(c: Any) -> bool: ...
def same_color(c1: Any, c2: Any) -> bool: ...
def makeMappingArray(N: int, data: Union[ArrayLike, Callable[[ndarray], ndarray]], gamma: float = ...) -> ndarray: ...
def get_named_colors_mapping() -> Dict[str, _ColorLike]: ...
# For backwards compatibility; not documented in the docs but explicitly written in the code.
cnames: Dict[str, str]
hexColorPattern: Pattern
def rgb2hex(c: Union[_ColorLike, MaskedArray], keep_alpha: bool = ...) -> str: ...
def hex2color(c: Union[_ColorLike, MaskedArray]) -> Tuple[float, float, float]: ...

44
matplotlib/container.pyi Normal file
Просмотреть файл

@ -0,0 +1,44 @@
# COMPLETE
from typing import Any, Callable, List, Optional, Tuple, TypeVar, Union
from matplotlib.collections import LineCollection
from matplotlib.lines import Line2D
from matplotlib.patches import Rectangle
_T = TypeVar("_T")
# These would be better represented as variadic types, which are not yet accepted.
class Container(Tuple[_T]):
eventson: bool
def __init__(self, kl: Any, label: Optional[str] = ...) -> None: ...
def get_children(self) -> List[_T]: ...
# Copied from Artist.
def add_callback(self, func: Callable[[_T], Any]) -> int: ...
def remove_callback(self, oid: int) -> None: ...
def get_label(self) -> str: ...
def set_label(self, s: object) -> None: ...
def pchanged(self) -> None: ...
class BarContainer(Container[Rectangle]):
patches: List[Rectangle]
errorbar: Optional[ErrorbarContainer]
def __init__(self, patches: List[Rectangle], errorbar: Optional[ErrorbarContainer] = ..., **kwargs: Any) -> None: ...
class ErrorbarContainer(Container[Union[LineCollection, Line2D]]):
has_xerr: bool
has_yerr: bool
def __init__(self, lines: Tuple[Line2D, Tuple[Line2D, ...], List[LineCollection]], has_xerr: bool = ..., has_yerr: bool = ..., **kwargs: Any) -> None: ...
class StemContainer(Container[Union[LineCollection, Line2D]]):
markerline: LineCollection
stemlines: LineCollection
baseline: Line2D
def __init__(self, markerline_stemlines_baseline: Tuple[LineCollection, LineCollection, Line2D], **kwargs: Any) -> None: ...

16
matplotlib/contour.pyi Normal file
Просмотреть файл

@ -0,0 +1,16 @@
from typing import Any
from matplotlib.cm import ScalarMappable
class ContourLabeler:
def __getattr__(self, name: str) -> Any: ... # incomplete
class ContourSet(ScalarMappable, ContourLabeler):
def __getattr__(self, name: str) -> Any: ... # incomplete
class QuadContourSet(ContourSet):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/dates.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/docstring.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/dviread.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

10
matplotlib/figure.pyi Normal file
Просмотреть файл

@ -0,0 +1,10 @@
from typing import Any
from matplotlib.artist import Artist
class Figure(Artist):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

166
matplotlib/font_manager.pyi Normal file
Просмотреть файл

@ -0,0 +1,166 @@
# COMPLETE
import sys
from pathlib import Path
from typing import Any, Dict, Iterable, List, Literal, Optional, Tuple, Union
from _typeshed import AnyPath
from matplotlib.afm import AFM
from matplotlib.ft2font import FT2Font
_Style = Literal['normal', 'italic', 'oblique']
_Variant = Literal['normal', 'small-caps']
_Weight = Literal[
'ultralight',
'light',
'normal',
'regular',
'book',
'medium',
'roman',
'semibold',
'demibold',
'demi',
'bold',
'heavy',
'extra bold',
'black'
]
_Stretch = Literal[
'ultra-condensed',
'extra-condensed',
'condensed',
'semi-condensed',
'normal',
'semi-expanded',
'expanded',
'extra-expanded',
'ultra-expanded'
]
_Size = Literal[
'xx-small',
'x-small',
'small',
'medium',
'large',
'x-large',
'xx-large'
]
class FontEntry:
fname: AnyPath
name: str
style: _Style
variant: _Variant
weight: Union[_Weight, int]
stretch: Union[_Stretch, int]
size: Union[_Size, float]
def __init__(
self,
fname: AnyPath = ...,
name: str = ...,
style: _Style = ...,
variant: _Variant = ...,
weight: Union[_Weight, int] = ...,
stretch: Union[_Stretch, int] = ...,
size: Union[_Size, float] = ...
) -> None: ...
class FontManager:
def __init__(self, size: Optional[int] = ..., weight: Literal["normal", "bold"] = ...) -> None: ...
def addfont(self, path: Union[str, Path]) -> None: ...
def findfont(
self,
prop: Union[str, FontProperties],
fontext: Literal['ttf', 'afm'] = ...,
directory: Optional[str] = ...,
fallback_to_default: bool = ...,
rebuild_if_missing: bool = ...
) -> str: ...
@staticmethod
def get_default_size() -> int: ...
def get_default_weight(self) -> Literal['normal', 'bold']: ...
def set_default_weight(self, weight: Literal['normal', 'bold']) -> None: ...
def score_family(self, families: Union[List[str], Tuple[str], str], family2: str) -> float: ...
def score_size(self, size1: Any, size2: Any) -> float: ...
def score_stretch(self, stretch1: Any, stretch2: Any) -> float: ...
def score_style(self, style1: Any, style2: Any) -> float: ...
def score_variant(self, variant1: Any, variant2: Any) -> float: ...
def score_weight(self, weight1: _Weight, weight2: _Weight) -> float: ...
@property
def defaultFont(self) -> Dict[str, str]: ...
class FontProperties:
def __init__(
self,
family: Optional[str] = ...,
style: Optional[_Style] = ...,
variant: Optional[_Variant] = ...,
weight: Optional[Union[_Weight, int]] = ...,
stretch: Optional[Union[_Stretch, int]] = ...,
size: Union[_Size, int] = ...,
fname: Optional[AnyPath] = ...
) -> None: ...
def copy(self) -> FontProperties: ...
def get_family(self) -> List[str]: ...
def set_family(self, family: Union[str, List[str]]) -> None: ...
def get_file(self) -> Optional[AnyPath]: ...
def set_file(self, file: Optional[AnyPath]) -> None: ...
def get_fontconfig_pattern(self) -> Dict[str, List[str]]: ...
def set_fontconfig_pattern(self, pattern: str) -> None: ...
def get_name(self) -> str: ...
def set_name(self, family: Union[str, List[str]]) -> None: ...
def get_size(self) -> float: ...
def get_size_in_points(self)-> float: ...
def set_size(self, size: Optional[Union[float, _Size]]) -> None: ...
def get_slant(self) -> _Style: ...
def set_slant(self, style: _Style) -> None: ...
def get_stretch(self) -> Union[int, _Stretch]: ...
def set_stretch(self, stretch: Optional[Union[int, _Stretch]]) -> None: ...
def get_style(self) -> _Style: ...
def set_style(self, style: _Style) -> None: ...
def get_variant(self) -> _Variant: ...
def set_variant(self, variant: Optional[_Variant]) -> None: ...
def get_weight(self) -> Union[int, _Weight]: ...
def set_weight(self, weight: Optional[Union[int, _Weight]]) -> None: ...
def afmFontProperty(fontpath: AnyPath, font: AFM) -> FontEntry: ...
def findSystemFonts(fontpaths: Optional[Union[str, Iterable[AnyPath]]] = ..., fontext: str = ...) -> List[str]: ...
# FontManager.findfont
def findfont(
prop: Union[str, FontProperties],
fontext: Literal['ttf', 'afm'] = ...,
directory: Optional[str] = ...,
fallback_to_default: bool = ...,
rebuild_if_missing: bool = ...
) -> str: ...
def get_font(filename: AnyPath, hinting_factor: Optional[int] = ...) -> FT2Font: ...
def get_fontconfig_fonts(fontext: str = ...) -> List[str]: ...
def get_fontext_synonyms(fontext: str) -> str: ...
def is_opentype_cff_font(filename: str) -> bool: ...
def json_dump(data: FontManager, filename: AnyPath) -> None: ...
def json_load(filename: AnyPath) -> FontManager: ...
def list_fonts(directory: AnyPath, extensions: Iterable[str]) -> List[str]: ...
def ttfFontProperty(font: FT2Font) -> FontEntry: ...
if sys.platform == 'win32':
def win32FontDirectory() -> str: ...
def win32InstalledFonts(directory: Optional[str] = ..., fontext: Literal['ttf', 'afm'] = ...) -> List[str]: ...

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

273
matplotlib/ft2font.pyi Normal file
Просмотреть файл

@ -0,0 +1,273 @@
# Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)]
# Library: matplotlib, version: 3.4.0
# Module: matplotlib.ft2font, version: unspecified
import typing
import builtins as _mod_builtins
BOLD: int
EXTERNAL_STREAM: int
FAST_GLYPHS: int
FIXED_SIZES: int
FIXED_WIDTH: int
class FT2Font(_mod_builtins.object):
'Create a new FT2Font object.\n\nAttributes\n----------\nnum_faces\n Number of faces in file.\nface_flags, style_flags : int\n Face and style flags; see the ft2font constants.\nnum_glyphs\n Number of glyphs in the face.\nfamily_name, style_name\n Face family and style name.\nnum_fixed_sizes\n Number of bitmap in the face.\nscalable\n Whether face is scalable; attributes after this one are only\n defined for scalable faces.\nbbox\n Face global bounding box (xmin, ymin, xmax, ymax).\nunits_per_EM\n Number of font units covered by the EM.\nascender, descender\n Ascender and descender in 26.6 units.\nheight\n Height in 26.6 units; used to compute a default line spacing\n (baseline-to-baseline distance).\nmax_advance_width, max_advance_height\n Maximum horizontal and vertical cursor advance for all glyphs.\nunderline_position, underline_thickness\n Vertical position and thickness of the underline bar.\npostscript_name\n PostScript name of the font.\n'
def __init__(self, *args, **kwargs) -> None:
'Create a new FT2Font object.\n\nAttributes\n----------\nnum_faces\n Number of faces in file.\nface_flags, style_flags : int\n Face and style flags; see the ft2font constants.\nnum_glyphs\n Number of glyphs in the face.\nfamily_name, style_name\n Face family and style name.\nnum_fixed_sizes\n Number of bitmap in the face.\nscalable\n Whether face is scalable; attributes after this one are only\n defined for scalable faces.\nbbox\n Face global bounding box (xmin, ymin, xmax, ymax).\nunits_per_EM\n Number of font units covered by the EM.\nascender, descender\n Ascender and descender in 26.6 units.\nheight\n Height in 26.6 units; used to compute a default line spacing\n (baseline-to-baseline distance).\nmax_advance_width, max_advance_height\n Maximum horizontal and vertical cursor advance for all glyphs.\nunderline_position, underline_thickness\n Vertical position and thickness of the underline bar.\npostscript_name\n PostScript name of the font.\n'
...
@classmethod
def __init_subclass__(cls) -> None:
'This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n'
...
@classmethod
def __subclasshook__(cls, subclass: typing.Any) -> bool:
'Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n'
...
@property
def ascender(self) -> typing.Any:
...
@property
def bbox(self) -> typing.Any:
...
def clear(self) -> typing.Any:
'Clear all the glyphs, reset for a new call to `.set_text`.\n'
...
@property
def descender(self) -> typing.Any:
...
def draw_glyph_to_bitmap(self, bitmap, x, y, glyph) -> typing.Any:
'Draw a single glyph to the bitmap at pixel locations x, y\nNote it is your responsibility to set up the bitmap manually\nwith ``set_bitmap_size(w, h)`` before this call is made.\n\nIf you want automatic layout, use `.set_text` in combinations with\n`.draw_glyphs_to_bitmap`. This function is instead intended for people\nwho want to render individual glyphs (e.g., returned by `.load_char`)\nat precise locations.\n'
...
def draw_glyphs_to_bitmap(self) -> typing.Any:
'Draw the glyphs that were loaded by `.set_text` to the bitmap.\nThe bitmap size will be automatically set to include the glyphs.\n'
...
@property
def face_flags(self) -> typing.Any:
...
@property
def family_name(self) -> typing.Any:
...
@property
def fname(self) -> typing.Any:
...
def get_bitmap_offset(self) -> typing.Any:
'Get the (x, y) offset in 26.6 subpixels for the bitmap if ink hangs left or below (0, 0).\nSince Matplotlib only supports left-to-right text, y is always 0.\n'
...
def get_char_index(self, codepoint) -> typing.Any:
'Return the glyph index corresponding to a character *codepoint*.\n'
...
def get_charmap(self) -> typing.Any:
'Return a dict that maps the character codes of the selected charmap\n(Unicode by default) to their corresponding glyph indices.\n'
...
def get_descent(self) -> typing.Any:
'Get the descent in 26.6 subpixels of the current string set by `.set_text`.\nThe rotation of the string is accounted for. To get the descent\nin pixels, divide this value by 64.\n'
...
def get_glyph_name(self, index) -> typing.Any:
"Retrieve the ASCII name of a given glyph *index* in a face.\n\nDue to Matplotlib's internal design, for fonts that do not contain glyph\nnames (per FT_FACE_FLAG_GLYPH_NAMES), this returns a made-up name which\ndoes *not* roundtrip through `.get_name_index`.\n"
...
def get_image(self) -> typing.Any:
'Return the underlying image buffer for this font object.\n'
...
def get_kerning(self, left, right, mode) -> typing.Any:
'Get the kerning between *left* and *right* glyph indices.\n*mode* is a kerning mode constant:\n KERNING_DEFAULT - Return scaled and grid-fitted kerning distances\n KERNING_UNFITTED - Return scaled but un-grid-fitted kerning distances\n KERNING_UNSCALED - Return the kerning vector in original font units\n'
...
def get_name_index(self, name) -> typing.Any:
"Return the glyph index of a given glyph *name*.\nThe glyph index 0 means 'undefined character code'.\n"
...
def get_num_glyphs(self) -> typing.Any:
'Return the number of loaded glyphs.\n'
...
def get_path(self) -> typing.Any:
'Get the path data from the currently loaded glyph as a tuple of vertices, codes.\n'
...
def get_ps_font_info(self) -> typing.Any:
'Return the information in the PS Font Info structure.\n'
...
def get_sfnt(self) -> typing.Any:
'Load the entire SFNT names table, as a dict whose keys are\n(platform-ID, ISO-encoding-scheme, language-code, and description)\ntuples.\n'
...
def get_sfnt_table(self, name) -> typing.Any:
'Return one of the following SFNT tables: head, maxp, OS/2, hhea, vhea, post, or pclt.\n'
...
def get_width_height(self) -> typing.Any:
'Get the width and height in 26.6 subpixels of the current string set by `.set_text`.\nThe rotation of the string is accounted for. To get width and height\nin pixels, divide these values by 64.\n'
...
def get_xys(self) -> typing.Any:
'Get the xy locations of the current glyphs.\n'
...
@property
def height(self) -> typing.Any:
...
def load_char(self, charcode, flags) -> typing.Any:
'Load character with *charcode* in current fontfile and set glyph.\n*flags* can be a bitwise-or of the LOAD_XXX constants;\nthe default value is LOAD_FORCE_AUTOHINT.\nReturn value is a Glyph object, with attributes\n width # glyph width\n height # glyph height\n bbox # the glyph bbox (xmin, ymin, xmax, ymax)\n horiBearingX # left side bearing in horizontal layouts\n horiBearingY # top side bearing in horizontal layouts\n horiAdvance # advance width for horizontal layout\n vertBearingX # left side bearing in vertical layouts\n vertBearingY # top side bearing in vertical layouts\n vertAdvance # advance height for vertical layout\n'
...
def load_glyph(self, glyphindex, flags) -> typing.Any:
'Load character with *glyphindex* in current fontfile and set glyph.\n*flags* can be a bitwise-or of the LOAD_XXX constants;\nthe default value is LOAD_FORCE_AUTOHINT.\nReturn value is a Glyph object, with attributes\n width # glyph width\n height # glyph height\n bbox # the glyph bbox (xmin, ymin, xmax, ymax)\n horiBearingX # left side bearing in horizontal layouts\n horiBearingY # top side bearing in horizontal layouts\n horiAdvance # advance width for horizontal layout\n vertBearingX # left side bearing in vertical layouts\n vertBearingY # top side bearing in vertical layouts\n vertAdvance # advance height for vertical layout\n'
...
@property
def max_advance_height(self) -> typing.Any:
...
@property
def max_advance_width(self) -> typing.Any:
...
@property
def num_charmaps(self) -> typing.Any:
...
@property
def num_faces(self) -> typing.Any:
...
@property
def num_fixed_sizes(self) -> typing.Any:
...
@property
def num_glyphs(self) -> typing.Any:
...
@property
def postscript_name(self) -> typing.Any:
...
@property
def scalable(self) -> typing.Any:
...
def select_charmap(self, i) -> typing.Any:
'Select a charmap by its FT_Encoding number.\n'
...
def set_charmap(self, i) -> typing.Any:
'Make the i-th charmap current.\n'
...
def set_size(self, ptsize, dpi) -> typing.Any:
'Set the point size and dpi of the text.\n'
...
def set_text(self, string, angle, flags) -> typing.Any:
'Set the text *string* and *angle*.\n*flags* can be a bitwise-or of the LOAD_XXX constants;\nthe default value is LOAD_FORCE_AUTOHINT.\nYou must call this before `.draw_glyphs_to_bitmap`.\nA sequence of x,y positions is returned.\n'
...
@property
def style_flags(self) -> typing.Any:
...
@property
def style_name(self) -> typing.Any:
...
@property
def underline_position(self) -> typing.Any:
...
@property
def underline_thickness(self) -> typing.Any:
...
@property
def units_per_EM(self) -> typing.Any:
...
def __getattr__(self, name) -> typing.Any:
...
class FT2Image(_mod_builtins.object):
def __init__(self, *args, **kwargs) -> None:
...
@classmethod
def __init_subclass__(cls) -> None:
'This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n'
...
@classmethod
def __subclasshook__(cls, subclass: typing.Any) -> bool:
'Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n'
...
def draw_rect(self, x0, y0, x1, y1) -> typing.Any:
'Draw an empty rectangle to the image.\n'
...
def draw_rect_filled(self, x0, y0, x1, y1) -> typing.Any:
'Draw a filled rectangle to the image.\n'
...
def __getattr__(self, name) -> typing.Any:
...
GLYPH_NAMES: int
HORIZONTAL: int
ITALIC: int
KERNING: int
KERNING_DEFAULT: int
KERNING_UNFITTED: int
KERNING_UNSCALED: int
LOAD_CROP_BITMAP: int
LOAD_DEFAULT: int
LOAD_FORCE_AUTOHINT: int
LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH: int
LOAD_IGNORE_TRANSFORM: int
LOAD_LINEAR_DESIGN: int
LOAD_MONOCHROME: int
LOAD_NO_AUTOHINT: int
LOAD_NO_BITMAP: int
LOAD_NO_HINTING: int
LOAD_NO_RECURSE: int
LOAD_NO_SCALE: int
LOAD_PEDANTIC: int
LOAD_RENDER: int
LOAD_TARGET_LCD: int
LOAD_TARGET_LCD_V: int
LOAD_TARGET_LIGHT: int
LOAD_TARGET_MONO: int
LOAD_TARGET_NORMAL: int
LOAD_VERTICAL_LAYOUT: int
MULTIPLE_MASTERS: int
SCALABLE: int
SFNT: int
VERTICAL: int
__doc__: typing.Any
__file__: str
__freetype_build_type__: str
__freetype_version__: str
__name__: str
__package__: str
def __getattr__(name) -> typing.Any:
...

4
matplotlib/gridspec.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

155
matplotlib/image.pyi Normal file
Просмотреть файл

@ -0,0 +1,155 @@
# COMPLETE
from pathlib import Path
from typing import Any, BinaryIO, Collection, Dict, Literal, Optional, Tuple, Union
from PIL.Image import Image as PILImage
from matplotlib._typing import ArrayLike, ndarray
from matplotlib.artist import Artist
from matplotlib.axes import Axes
from matplotlib.backend_bases import LocationEvent, MouseEvent, RendererBase
from matplotlib.cm import Colormap, ScalarMappable
from matplotlib.colors import Normalize
from matplotlib.figure import Figure
from matplotlib.transforms import Affine2D, Bbox
_PathOrIO = Union[str, Path, BinaryIO]
class _ImageBase(Artist, ScalarMappable):
def __init__(
self,
ax: Axes,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_size(self) -> Tuple[int, int]: ...
def set_alpha(self, alpha: float) -> None: ...
def changed(self) -> None: ...
def make_image(self, renderer: RendererBase, magnification: float = ..., unsampled: bool = ...) -> Tuple[ndarray, Tuple[float, float], Affine2D]: ...
def draw(self, renderer: RendererBase, *args: Any, **kwargs: Any) -> None: ...
def contains(self, mouseevent: MouseEvent) -> Tuple[bool, Dict[Any, Any]]: ...
def write_png(self, fname: _PathOrIO) -> None: ...
def set_data(self, A: Union[ArrayLike, PILImage]) -> None: ...
def set_array(self, A: ArrayLike) -> None: ...
def get_interpolation(self) -> str: ...
def set_interpolation(self, s: str) -> None: ...
def can_composite(self) -> bool: ...
def set_resample(self, v: Optional[bool]) -> None: ...
def get_resample(self) -> bool: ...
def set_filternorm(self, filternorm: bool) -> None: ...
def get_filternorm(self) -> bool: ...
def set_filterrad(self, filterrad: float) -> None: ...
def get_filterrad(self) -> float: ...
class AxesImage(_ImageBase):
def __init__(
self,
ax: Axes,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
extent: Optional[Tuple[float, float, float, float]] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def format_cursor_data(self, data: ArrayLike) -> str: ...
def get_cursor_data(self, event: LocationEvent) -> Optional[ndarray]: ...
def set_extent(self, extent: Tuple[float, float, float, float]) -> None: ...
def get_extent(self) -> Tuple[float, float, float, float]: ...
def get_window_extent(self, renderer: Optional[RendererBase] = ...) -> Tuple[float, float, float, float]: ...
class NonUniformImage(AxesImage):
def __init__(self, ax: Axes, *, interpolation: str = ..., **kwargs: Any) -> None: ...
@property
def is_grayscale(self) -> bool: ...
def set_cmap(self, cmap: Optional[Union[str, Colormap]]) -> None: ...
def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ...
def set_norm(self, norm: Optional[Normalize]) -> None: ...
class PcolorImage(AxesImage):
def __init__(
self,
ax: Axes,
x: Optional[ArrayLike] = ...,
y: Optional[ArrayLike] = ...,
A: Optional[ArrayLike] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
**kwargs: Any
) -> None: ...
@property
def is_grayscale(self) -> bool: ...
def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ...
class BboxImage(_ImageBase):
def __init__(
self,
bbox: Bbox,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_window_extent(self, renderer: Optional[RendererBase] = ...) -> Tuple[float, float, float, float]: ...
class FigureImage(_ImageBase):
def __init__(
self,
fig: Figure,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
interpolation: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
filternorm: bool = ...,
filterrad: float = ...,
resample: bool = ...,
**kwargs: Any
) -> None: ...
def get_extent(self) -> Tuple[float, float, float, float]: ...
def composite_images(images: Collection[_ImageBase], renderer: RendererBase, magnification: float = ...) -> Tuple[ndarray, float, float]: ...
def imread(fname: _PathOrIO, format: Optional[str] = ...) -> ndarray: ...
def imsave(
fname: _PathOrIO,
arr: ArrayLike,
vmin: Optional[float] = ...,
vmax: Optional[float] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
format: Optional[str] = ...,
origin: Optional[Literal['upper', 'lower']] = ...,
dpi: float = ...,
*,
metadata: Optional[Dict[Any, Any]] = ...,
pil_kwargs: Optional[Dict[str, Any]] = ...
) -> None: ...
def pil_to_array(pilImage: PILImage) -> ndarray: ...
def thumbnail(infile: _PathOrIO, thumbfile: _PathOrIO, scale: float = ..., interpolation: str = ..., preview: bool = ...) -> Figure: ...

10
matplotlib/legend.pyi Normal file
Просмотреть файл

@ -0,0 +1,10 @@
from typing import Any
from matplotlib.artist import Artist
class Legend(Artist):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

42
matplotlib/lines.pyi Normal file
Просмотреть файл

@ -0,0 +1,42 @@
from typing import Any, List, Literal, Optional, Tuple, Union
from matplotlib._typing import ArrayLike
from matplotlib.artist import Artist
from matplotlib.colors import _ColorLike
from matplotlib.markers import MarkerStyle
_LineStyle = Union[
Literal['-', 'solid', '--', 'dashed', '-.', 'dashdot', ':', 'dotted', 'None', ' ', ''],
Tuple[int, Tuple[int, ...]]
]
class Line2D(Artist):
def __init__(
self,
xdata: ArrayLike,
ydata: ArrayLike,
linewidth: Optional[float] = ...,
linestyle: Optional[_LineStyle] = ...,
color: Optional[_ColorLike] = ...,
marker: Optional[MarkerStyle] = ...,
markersize: Optional[float] = ...,
markeredgewidth: Optional[float] = ...,
markeredgecolor: Optional[_ColorLike] = ...,
markerfacecolor: Optional[_ColorLike] = ...,
markerfacecoloralt: Optional[_ColorLike] = ...,
fillstyle: Optional[Literal['full', 'left', 'right', 'bottom', 'top', 'none']] = ...,
antialiased: Optional[bool] = ...,
dash_capstyle: Optional[Literal['butt', 'round', 'projecting']] = ...,
solid_capstyle: Optional[Literal['butt', 'round', 'projecting']] = ...,
dash_joinstyle: Optional[Literal['miter', 'round', 'bevel']] = ...,
solid_joinstyle: Optional[Literal['miter', 'round', 'bevel']] = ...,
pickradius: float = ...,
drawstyle: Optional[Literal['default', 'steps', 'steps-pre', 'steps-mid', 'steps-post']] = ...,
markevery: Optional[Union[int, Tuple[int, int], slice, List[int], float, Tuple[float, float], List[bool]]] = ...,
**kwargs: Any,
) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

8
matplotlib/markers.pyi Normal file
Просмотреть файл

@ -0,0 +1,8 @@
from typing import Any
class MarkerStyle:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/mathtext.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/mlab.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/offsetbox.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

21
matplotlib/patches.pyi Normal file
Просмотреть файл

@ -0,0 +1,21 @@
from typing import Any
from matplotlib.artist import Artist
class Patch(Artist):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Polygon(Patch):
def __getattr__(self, name: str) -> Any: ... # incomplete
class FancyArrow(Polygon):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Wedge(Patch):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Rectangle(Patch):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/path.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

924
matplotlib/pyplot.pyi Normal file
Просмотреть файл

@ -0,0 +1,924 @@
# https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot
from datetime import tzinfo
from typing import (
Any,
BinaryIO,
Callable,
ContextManager,
Dict,
List,
Literal,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
overload,
)
import cycler as cycler # undocumented
from matplotlib import interactive as interactive, set_loglevel as set_loglevel # undocumented
from matplotlib._typing import ArrayLike, Scalar, _DetrendCallable, ndarray
from matplotlib.artist import Artist
from matplotlib.axes import Axes as Axes, SubplotBase # undocumented
from matplotlib.backend_bases import Event, FigureManagerBase
from matplotlib.cm import Colormap, ScalarMappable, get_cmap as get_cmap, register_cmap as register_cmap # undocumented
from matplotlib.collections import (
BrokenBarHCollection,
Collection,
EventCollection,
LineCollection,
PathCollection,
PolyCollection,
QuadMesh,
)
from matplotlib.colorbar import Colorbar
from matplotlib.colors import Normalize as Normalize, _ColorLike # undocumented
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
from matplotlib.contour import ContourSet, QuadContourSet
from matplotlib.figure import Figure
from matplotlib.image import AxesImage, FigureImage
from matplotlib.legend import Legend
from matplotlib.lines import Line2D as Line2D # undocumented
from matplotlib.markers import MarkerStyle
from matplotlib.patches import Circle as Circle, FancyArrow, Polygon, Rectangle as Rectangle, Wedge # undocumented
from matplotlib.quiver import Barbs, Quiver, QuiverKey
from matplotlib.scale import get_scale_names as get_scale_names # undocumented
from matplotlib.streamploy import StreamplotSet
from matplotlib.table import Table
from matplotlib.text import Annotation, Text as Text # undocumented
from matplotlib.ticker import ( # undocumented
FixedFormatter as FixedFormatter,
FormatStrFormatter as FormatStrFormatter,
FuncFormatter as FuncFormatter,
LinearLocator as LinearLocator,
LogLocator as LogLocator,
MaxNLocator as MaxNLocator,
MultipleLocator as MultipleLocator,
NullLocator as NullLocator,
)
from matplotlib.transforms import Bbox
from matplotlib.widgets import Slider as Slider, SubplotTool # undocumented
from PIL.Image import Image
from . import cbook as cbook, cm as cm, style as style # undocumented
# TODO: data params need to be Dicts/mappings?
# TODO: Are some of these more reasonable in tooltips when split out as overloads?
def acorr(x: ArrayLike, *, data: Optional[Any] = ..., **kwargs: Any) -> Tuple[ndarray, ndarray, Union[LineCollection, Line2D], Optional[Line2D]]: ...
def angle_spectrum(
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
def annotate(s: str, xy: Tuple[float, float], *args: Any, **kwargs: Any) -> Annotation: ...
def arrow(x: float, y: float, dx: float, dy: float, **kwargs: Any) -> FancyArrow: ...
def autoscale(enable: Optional[bool] = ..., axis: Optional[Literal["both", "x", "y"]] = ..., tight: Optional[bool] = ...) -> None: ...
def autumn() -> None: ...
def axes(arg: Optional[Tuple[float, float, float, float]] = ..., **kwargs: Any) -> Axes: ...
def axhline(y: Optional[Scalar] = ..., xmin: Optional[Scalar] = ..., xmax: Optional[Scalar] = ..., **kwargs: Any) -> Line2D: ...
def axhspan(ymin: float, ymax: float, xmin: Optional[int] = ..., xmax: Optional[int] = ..., **kwargs: Any) -> Polygon: ...
# TODO: write overloads for various forms
def axis(*args: Any, **kwargs: Any) -> Tuple[float, float, float, float]: ...
def axline(xy1: Optional[Tuple[float, float]], xy2: Optional[Tuple[float, float]] = ..., *, slope: Optional[float] = ..., **kwargs: Any) -> Line2D: ...
def axvline(x: Optional[Scalar] = ..., ymin: Optional[Scalar] = ..., ymax: Optional[Scalar] = ..., **kwargs: Any) -> Line2D: ...
def axvspan(xmin: Scalar, xmax: Scalar, ymin: Optional[Scalar] = ..., ymax: Optional[Scalar] = ..., **kwargs: Any) -> Polygon: ...
# Docs are misleading about this
def bar(
x: Union[Scalar, ArrayLike],
height: Union[Scalar, ArrayLike],
width: Optional[Union[Scalar, ArrayLike]] = ...,
bottom: Optional[Union[Scalar, ArrayLike]] = ...,
*,
align: Literal["center", "edge"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> BarContainer: ...
def bar_label(
container: BarContainer,
labels: Optional[ArrayLike] = ...,
*,
fmt: str = ...,
label_type: Literal['edge', 'center'] = ...,
padding: float = ...,
**kwargs: Any
) -> List[Text]: ...
# TODO: write overloads for various forms
def barbs(*args: Any, data: Optional[Any] = ..., **kwargs: Any) -> Barbs: ...
# barh is just bar, but x=left and bottom=y
def barh(
y: Union[Scalar, ArrayLike],
width: Union[Scalar, ArrayLike],
height: Optional[Union[Scalar, ArrayLike]] = ...,
left: Optional[Union[Scalar, ArrayLike]] = ...,
*,
align: Literal["center", "edge"] = ...,
**kwargs: Any
) -> BarContainer: ...
def bone() -> None: ...
def box(On: Optional[bool] = ...) -> None: ...
def boxplot(
x: Union[ArrayLike, Sequence[ArrayLike]],
notch: Optional[bool] = ...,
sym: Optional[str] = ...,
vert: Optional[bool] = ...,
whis: Optional[Union[float, ArrayLike, str]] = ...,
positions: Optional[ArrayLike] = ...,
widths: Optional[Union[Scalar, ArrayLike]] = ...,
patch_artist: Optional[bool] = ...,
bootstrap: Optional[int] = ...,
usermedians: Optional[ArrayLike] = ...,
conf_intervals: Optional[ArrayLike] = ...,
meanline: Optional[bool] = ...,
showmeans: Optional[bool] = ...,
showcaps: Optional[bool] = ...,
showbox: Optional[bool] = ...,
showfliers: Optional[bool] = ...,
boxprops: Optional[Dict[Any, Any]] = ...,
labels: Optional[Sequence[Any]] = ...,
flierprops: Optional[Any] = ...,
medianprops: Optional[Dict[Any, Any]] = ...,
meanprops: Optional[Dict[Any, Any]] = ...,
capprops: Optional[Dict[Any, Any]] = ...,
whiskerprops: Optional[Dict[Any, Any]] = ...,
manage_ticks: Optional[bool] = ...,
autorange: Optional[bool] = ...,
zorder: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...
) -> Dict[str, Line2D]: ...
def broken_barh(xranges: Sequence[Tuple[float, float]], yrange: Tuple[float, float], *, data: Optional[Any] = ..., **kwargs: Any) -> BrokenBarHCollection: ...
def cla() -> None: ...
def clabel(CS: ContourSet, *args: Any, **kwargs: Any) -> List[Text]: ...
def clf() -> None: ...
def clim(vmin: Optional[float] = ..., vmax: Optional[float] = ...) -> None: ...
def close(fig: Optional[Union[int, str, Figure]] = ...) -> None: ...
def cohere(
x: ArrayLike, y: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray]: ... # ArrayLike?
def colorbar(mappable: Optional[ScalarMappable] = ..., cax: Optional[Axes] = ..., ax: Optional[Union[Axes, Sequence[Axes]]] = ..., **kwargs: Any) -> Colorbar: ...
# Should be colormap?
def colormaps() -> Dict[str, Colormap]: ...
def connect(s: str, func: Callable[[Event], None]) -> int: ...
# TODO: write overloads for various forms
def contour(*args: Any, data: Optional[Any] = ..., **kwargs: Any) -> QuadContourSet: ...
def contourf(*args: Any, data: Optional[Any] = ..., **kwargs: Any) -> QuadContourSet: ...
def cool() -> None: ...
def copper() -> None: ...
def csd(
x: ArrayLike, y: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
return_line: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, Line2D]: ... # ArrayLike?
def delaxes(ax: Optional[Axes]) -> None: ...
def disconnect(cid: int) -> None: ...
def draw() -> None: ...
def draw_if_interactive() -> None: ...
def errorbar(
x: ArrayLike, y: ArrayLike,
yerr: Optional[Union[Scalar, ArrayLike]] = ...,
xerr: Optional[Union[Scalar, ArrayLike]] = ...,
fmt: str = ...,
ecolor: Optional[_ColorLike] = ...,
elinewidth: Optional[Scalar] = ...,
capsize: Optional[Scalar] = ...,
barsabove: bool = ...,
lolims: bool = ...,
uplims: bool = ...,
xlolims: bool = ...,
xuplims: bool = ...,
errorevery: int = ...,
capthick: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> ErrorbarContainer: ...
def eventplot(
positions: ArrayLike,
orientation: Optional[Literal["horizontal", "vertical"]],
lineoffsets: Optional[Union[Scalar, ArrayLike]] = ...,
linelengths: Optional[Union[Scalar, ArrayLike]] = ...,
linewidths: Optional[Union[Scalar, ArrayLike]] = ...,
colors: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ...,
linestyles: Union[str, Tuple[str, ...], Sequence[Any]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[EventCollection]: ...
# TODO: write overloads for various forms
def figimage(*args: Any, **kwargs: Any) -> FigureImage: ...
# TODO: write overloads for various forms
def figlegend(*args: Any, **kwargs: Any) -> Legend: ...
def fignum_exists(num: Any) -> bool: ...
def figtext(x: float, y: float, s: str, *args: Any, **kwargs: Any) -> Text: ...
def figure(
num: Optional[Union[int, str]] = ...,
figsize: Optional[Tuple[float, float]] = ...,
dpi: Optional[int] = ...,
facecolor: Optional[_ColorLike] = ...,
edgecolor: Optional[_ColorLike] = ...,
frameon: bool = ...,
FigureClass: Type[Figure] = ...,
clear: bool = ...,
**kwargs: Any
) -> Figure: ...
# TODO: write overloads for various forms
def fill(*args: Any, data: Optional[Mapping[Any, Any]] = ..., **kwargs: Any) -> List[Polygon]: ...
def fill_between(
x: ArrayLike, y1: ArrayLike,
y2: Union[ArrayLike, Scalar] = ...,
where: Optional[ArrayLike] = ...,
interpolate: bool = ...,
step: Optional[Literal["pre", "post", "mid"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def fill_betweenx(
y: ArrayLike, x1: ArrayLike,
x2: Union[ArrayLike, Scalar] = ...,
where: Optional[ArrayLike] = ...,
interpolate: bool = ...,
step: Optional[Literal["pre", "post", "mid"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def findobj(
o: Optional[Any] = ...,
match: Optional[Union[
Callable[[Artist], bool],
Line2D,
]] = ...,
include_self: bool = ...
) -> List[Artist]: ...
def flag() -> None: ...
def gca(**kwargs: Any) -> Axes: ...
def gcf() -> Figure: ...
def gci() -> Optional[ScalarMappable]: ...
def get(obj: Artist, *args: Any, **kwargs: Any) -> Any: ...
def get_current_fig_manager() -> FigureManagerBase: ...
def get_figlabels() -> List[Any]: ...
def get_fignums() -> List[Any]: ...
def get_plot_commands() -> List[str]: ...
def getp(obj: Artist, *args: Any, **kwargs: Any) -> Any: ...
# TODO: write overloads for various forms
def ginput(*args: Any, **kwargs: Any) -> List[Tuple[float, float]]: ...
def gray() -> None: ...
def grid(b: Optional[bool] = ..., which: Literal["major", "minor", "both"] = ..., axis: Literal["both", "x", "y"] = ..., **kwargs: Any) -> None: ...
def hexbin(
x: ArrayLike, y: ArrayLike,
C: Optional[ArrayLike] = ...,
gridsize: Union[int, Tuple[int, int]] = ...,
bins: Optional[Union[Literal["log"], int, Sequence[Any]]] = ...,
xscale: Literal["linear", "log"] = ...,
yscale: Literal["linear", "log"] = ...,
extent: Optional[float] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
vmin: Optional[float] = ...,
vmax: Optional[float] = ...,
alpha: Optional[float] = ...,
linewidths: Optional[float] = ...,
edgecolors: Optional[Union[Literal["face", "none"], _ColorLike]] = ...,
reduce_C_function: Callable[[ArrayLike], float] = ...,
mincnt: Optional[int] = ...,
marginals: bool = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> PolyCollection: ...
def hist(
x: Union[ArrayLike, Sequence[ArrayLike]],
bins: Optional[Union[int, str, Sequence[Any]]],
range: Optional[Tuple] = ...,
density: Optional[bool] = ...,
weights: Optional[ArrayLike] = ...,
cumulative: bool = ...,
bottom: Optional[Union[ArrayLike, Scalar]] = ...,
histtype: Literal["bar", "barstacked", "step", "stepfilled"] = ...,
align: Literal["left", "mid", "right"] = ...,
orientation: Literal["vertical", "horizontal"] = ...,
rwidth: Optional[Scalar] = ...,
log: bool = ...,
color: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ...,
label: Optional[str] = ...,
stacked: bool = ...,
normed: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[Union[ArrayLike, List[ArrayLike]], ArrayLike, Union[List[Any], List[List[Any]]]]: ...
def hist2d(
x: ArrayLike, y: ArrayLike,
bins: Optional[Union[
int,
Tuple[int, int],
ArrayLike,
Tuple[ArrayLike, ArrayLike],
]] = ...,
range: Optional[ArrayLike] = ...,
density: bool = ...,
weights: Optional[ArrayLike] = ...,
cmin: Optional[Scalar] = ...,
cmax: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, ArrayLike, QuadMesh]: ...
def hlines(
y: Union[Scalar, ArrayLike],
xmin: Union[Scalar, ArrayLike],
xmax: Union[Scalar, ArrayLike],
colors: _ColorLike = ...,
linestyles: Literal['solid', 'dashed', 'dashdot', 'dotted'] = ...,
label: str = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> LineCollection: ...
def hot() -> None: ...
def hsv() -> None: ...
def imread(fname: Union[str, BinaryIO], format: Optional[str] = ...) -> ndarray: ...
def imsave(fname: Union[str, BinaryIO], arr: ArrayLike, **kwargs: Any) -> None: ...
def imshow(
X: Union[ArrayLike, Image],
cmap: Optional[Union[str, Colormap]] = ...,
norm: Optional[Normalize] = ...,
aspect: Optional[Union[Literal["equal", "auto"], float]] = ...,
interpolation: Optional[str] = ...,
alpha: Optional[Scalar] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
origin: Optional[Literal["upper", "lower"]] = ...,
extent: Optional[Tuple[Scalar, Scalar, Scalar, Scalar]] = ...,
shape: Any = ..., # deprecated
filternorm: bool = ...,
filterrad: float = ...,
imlim: Any = ..., # deprecated
resample: Optional[bool] = ...,
url: Optional[str] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> AxesImage: ...
def inferno() -> None: ...
def install_repl_displayhook() -> None: ...
def ioff() -> None: ...
def ion() -> None: ...
def isinteractive() -> None: ...
def jet() -> None: ...
# TODO: write overloads for various forms
def legend(*args: Any, **kwargs: Any) -> Legend: ...
def locator_params(axis: Optional[Literal["both", "x", "y"]] = ..., tight: Optional[bool] = ..., **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def loglog(*args: Any, **kwargs: Any) -> List[Line2D]: ...
def magma() -> None: ...
def magnitude_spectrum(
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
scale: Optional[Literal["default", "linear", "dB"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
def margins(*margins: float, x: Optional[float] = ..., y: Optional[float] = ..., tight: Optional[bool] = ...) -> Tuple[float, float]: ...
def matshow(A: ArrayLike, fignum: Optional[Union[int, Literal[False]]] = None, **kwargs: Any) -> AxesImage: ...
def minorticks_off() -> None: ...
def minorticks_on() -> None: ...
def new_figure_manager(num: Union[int, str], *args: Any, **kwargs: Any) -> FigureManagerBase: ...
def nipy_spectral() -> None: ...
def pause(interval: int) -> None: ...
# TODO: write overloads for various forms
def pcolor(
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> Collection: ...
# TODO: write overloads for various forms
def pcolormesh(
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
shading: Literal["flat", "gouraud"] = ...,
antialiased: Union[bool, Sequence[bool]] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> QuadMesh: ...
def phase_spectrum(
x: ArrayLike,
Fs: Optional[Scalar] = ...,
Fc: Optional[int] = ...,
window: Optional[Union[Callable[[Any], Any], ndarray]] = ...,
pad_to: Optional[int] = ...,
sides: Optional[Literal["default", "onesides", "twosided"]] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
def pie(
x: ArrayLike,
explode: Optional[ArrayLike]= ...,
labels: Optional[Sequence[str]] = ...,
colors: Optional[Sequence[_ColorLike]] = ...,
autopct: Optional[Union[str, Callable[..., str]]] = ...,
pctdistance: float = ...,
shadow: bool = ...,
labeldistance: Optional[float] = ...,
startangle: Optional[float] = ...,
radius: Optional[float] = ...,
counterclock: bool = ...,
wedgeprops: Optional[Dict[Any, Any]] = ...,
textprops: Optional[Dict[Any, Any]] = ...,
center: Sequence[float] = ...,
frame: bool = ...,
rotatelabels: bool = ...,
*,
data: Optional[Any] = ...,
) -> Tuple[List[Wedge], List[Text], List[Text]]: ...
def pink() -> None: ...
def plasma() -> None: ...
# TODO: write overloads for various forms
def plot(*args: Any, scalex: bool = ..., scaley: bool = ..., data: Optional[Any] = ..., **kwargs: Any) -> List[Line2D]: ...
def plot_date(
x: ArrayLike,
y: ArrayLike,
fmt: str = ...,
tz: Optional[Union[str, tzinfo]] = ...,
xdate: bool = ...,
ydate: bool = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[Line2D]: ...
# TODO: write overloads for various forms
def polar(*args: Any, **kwargs: Any) -> None: ...
def prism() -> None: ...
def psd(
x: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
return_line: Optional[bool] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ArrayLike, ArrayLike, Line2D]: ...
# TODO: write overloads for various forms
def quiver(*args: Any, data: Optional[Any] = ..., **kw: Any) -> Quiver: ...
def quiverkey(Q: Quiver, X: float, Y: float, U: float, label: str, **kw: Any) -> QuiverKey: ...
# Same as matplotlib.rc.
def rc(group: Union[str, Sequence[str]], **kwargs: Any) -> None: ...
# Same as matplotlib.rc_context.
def rc_context(rc: Optional[Mapping[Any, Any]] = ..., fname: Optional[str] = ...) -> ContextManager: ...
# Same as matplotlib.rcdefaults.
def rcdefaults() -> None: ...
# TODO: write overloads for various forms (below is a try at it)
@overload
def rgrids() -> Tuple[List[Line2D], List[Text]]: ...
@overload
def rgrids(radii: Tuple[float, ...], labels: Optional[Tuple[str, ...]] = ..., angle: float = ..., fmt: Optional[str] = ..., **kwargs: Any) -> Tuple[List[Line2D], List[Text]]: ...
# TODO: Need this when the above are present?
def rgrids(*args: Any, **kwargs: Any) -> Tuple[List[Line2D], List[Text]]: ...
# TODO: write overloads for various forms
def savefig(*args: Any, **kwargs: Any) -> None: ...
def sca(ax: Axes) -> None: ...
def scatter(
x: ArrayLike,
y: ArrayLike,
s: Optional[Union[Scalar, ArrayLike]] = ...,
c: Optional[Union[_ColorLike, Sequence[float], Sequence[_ColorLike]]] = ...,
marker: Optional[MarkerStyle] = ...,
cmap: Optional[Colormap] = ...,
norm: Optional[Normalize] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
alpha: Optional[Scalar] = ...,
linewidths: Optional[Union[Scalar, ArrayLike]] = ...,
verts: Optional[Any] = ..., # not documented?
edgecolors: Optional[Union[Literal["face", "none"], _ColorLike, Sequence[_ColorLike]]] = ...,
*,
plotnonfinite: bool = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> PathCollection: ...
# TODO: What is im supposed to be?
def sci(im: Any) -> None: ...
# TODO: write overloads for various forms (below is a try at it)
def semilogx(*args: Any, **kwargs: Any) -> List[Line2D]: ...
# TODO: write overloads for various forms (below is a try at it)
def semilogy(*args: Any, **kwargs: Any) -> List[Line2D]: ...
def set_cmap(cmap: Union[str, Colormap]) -> None: ...
def setp(obj: Artist, *args: Any, **kwargs: Any) -> None: ...
def show(*args: Any, **kw: Any) -> None: ...
def specgram(
x: ArrayLike,
NFFT: int = ...,
Fs: Scalar = ...,
Fc: int = ...,
detrend: Union[Literal["none", "mean", "linear"], _DetrendCallable] = ...,
window: Union[Callable, ndarray] = ...,
noverlap: int = ...,
cmap: Optional[Colormap] = ...,
xextent: Optional[Tuple[float, float]] = ...,
pad_to: Optional[int] = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: Optional[bool] = ...,
mode: Optional[Literal["default", "psd", "magnitude", "angle", "phase"]] = ...,
scale: Optional[Literal["default", "linear", "dB"]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, ndarray, AxesImage]: ...
def spring() -> None: ...
def spy(
Z: ArrayLike,
precision: Union[float, Literal["present"]] = ...,
marker: Optional[Any] = ..., # TODO
markersize: Optional[float] = ...,
aspect: Optional[Union[Literal["equal", "auto"], float]] = ...,
origin: Literal["upper", "lower"] = ...,
**kwargs: Any
) -> Union[AxesImage, Line2D]: ...
def stackplot(
x: ArrayLike,
*args: ArrayLike,
labels: Sequence[str] = ...,
colors: Optional[Sequence[_ColorLike]] = ...,
baseline: Literal["zero", "sym", "wiggle", "weighted_wiggle"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[PolyCollection]: ...
# TODO: write overloads for various forms
def stem(
*args: ArrayLike,
linefmt: Optional[str] = ...,
markerfmt: Optional[str] = ...,
basefmt: Optional[str] = ...,
bottom: float = ...,
label: Optional[str] = ...,
use_line_collection: bool = ...,
data: Optional[Any] = ...
) -> StemContainer: ...
# TODO: write overloads for various forms
def step(
x: ArrayLike,
y: ArrayLike,
*args: Any,
where: Literal["pre", "post", "mid"] = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> List[Line2D]: ...
def streamplot(
x: ArrayLike,
y: ArrayLike,
u: ArrayLike,
v: ArrayLike,
density: Union[float, Tuple[float, float]] = ...,
linewidth: Optional[Union[float, ArrayLike]] = ...,
color: Optional[Union[_ColorLike, ArrayLike]] = ...,
cmap: Optional[Colormap] = ...,
norm: Optional[Normalize] = ...,
arrowsize: float = ...,
arrowstyle: str = ...,
minlength: float = ...,
transform: Optional[Any] = ..., # TODO: what is this?
zorder: Optional[int] = ...,
start_points: Optional[ArrayLike] = ...,
maxlength: float = ...,
integration_direction: Literal["forward", "backward", "both"] = ...,
*,
data: Optional[Any] = ...,
) -> StreamplotSet: ... # TODO: does this type exist?
# TODO: write overloads for various forms
def subplot(*args: Any, **kwargs: Any) -> SubplotBase: ...
def subplot2grid(shape: Sequence[int], loc: Sequence[int], rowspan: int = ..., colspan: int = ..., fig: Optional[Figure] = ..., **kwargs: Any) -> None: ...
def subplot_mosaic(layout: Union[ArrayLike, str], *, subplot_kw: Optional[Dict[str, Any]] = ..., gridspec_kw: Optional[Dict[str, Any]] = ..., empty_sentinel: Any = ..., **fig_kw: Any) -> Tuple[Figure, Dict[str, Axes]]: ...
def subplot_tool(targetfig: Optional[Figure]) -> SubplotTool: ...
def subplots(
nrows: int = ...,
ncols: int = ...,
sharex: Union[bool, Literal["none", "all", "row", "col"]] = ...,
sharey: Union[bool, Literal["none", "all", "row", "col"]] = ...,
squeeze: bool = ...,
subplot_kw: Optional[Dict[Any, Any]] = ...,
gridspec_kw: Optional[Dict[Any, Any]] = ...,
**fig_kw: Any
) -> Tuple[Figure, Axes]: ...
def subplots_adjust(left: Optional[float] = ..., bottom: Optional[float] = ..., right: Optional[float] = ..., top: Optional[float] = ..., wspace: Optional[float] = ..., hspace: Optional[float] = ...) -> None: ...
def summer() -> None: ...
def suptitle(t: str, **kwargs: Any) -> Text: ...
def switch_backend(newbackend: str) -> None: ...
# TODO: resolve list vs sequence
def table(
cellText: Optional[Sequence[Sequence[str]]] = ...,
cellColours: Optional[Sequence[Sequence[_ColorLike]]] = ...,
cellLoc: Literal["left", "center", "right"] = ...,
colWidths: Optional[Sequence[float]] = ...,
rowLabels: Literal["left", "center", "right"] = ...,
rowColours: Literal["left", "center", "right"] = ...,
rowLoc: Literal["left", "center", "right"] = ...,
colLabels: Literal["left", "center", "right"] = ...,
colColours: Literal["left", "center", "right"] = ...,
colLoc: Literal["left", "center", "right"] = ...,
loc: str = ...,
bbox: Optional[Bbox] = ...,
edges: str = ..., # TODO: be more exact
**kwargs: Any
) -> Table: ...
def text(x: Scalar, y: Scalar, s: str, fontdict: Dict[Any, Any] = ..., withdash: Any = ..., **kwargs: Any) -> Text: ...
# TODO: write overloads for various forms
def thetagrids(*args: Any, **kwargs: Any) -> Tuple[List[Line2D], List[Text]]: ...
def tick_params(axis: Literal["x", "y", "both"] = ..., **kwargs: Any) -> None: ...
def ticklabel_format(
*,
axis: Literal["x", "y", "both"] = ...,
style: str = ...,
scilimits: Optional[Tuple[int, int]] = ...,
useOffset: Optional[Union[bool, int]] = ...,
useLocale: Optional[bool] = ...,
useMathText: Optional[bool] = ...,
) -> None: ...
def tight_layout(pad: float = ..., h_pad: Optional[float] = ..., w_pad: Optional[float] = ..., rect: Optional[Tuple[float, float, float, float]] = ...) -> None: ...
def title(label: str, fontdict: Optional[Dict[Any, Any]] = ..., loc: Literal["center", "left", "right"] = ..., pad: Optional[float] = ..., **kwargs: Any) -> Text: ...
# TODO: write overloads for various forms
def tricontour(*args: Any, **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def tricontourf(*args: Any, **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def tripcolor(
*args: Any,
alpha: Optional[Scalar] = ...,
norm: Optional[Normalize] = ...,
cmap: Optional[Union[str, Colormap]] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
shading: Literal["flat", "gouraud"] = ...,
facecolors: Optional[_ColorLike] = ..., # TODO: not sure if this is correct, the option is undocumented
**kwargs: Any
) -> None: ...
# TODO: write overloads for various forms
def triplot(*args: Any, **kwargs: Any) -> List[Line2D]: ...
def twinx(ax: Optional[Axes] = ...) -> Axes: ...
def twiny(ax: Optional[Axes] = ...) -> Axes: ...
def uninstall_repl_displayhook() -> None: ...
def violinplot(
dataset: ArrayLike,
positions: Optional[ArrayLike] = ...,
vert: bool = ...,
widths: ArrayLike = ..., # Default is 0.5, which is "array-like" even though it's a scalar.
showmeans: bool = ...,
showextrema: bool = ...,
showmedians: bool = ...,
points: Scalar = ...,
bw_method: Optional[Union[Literal["scott", "silverman"], Scalar, Callable]] = ...,
*,
data: Optional[Any] = ...,
) -> Dict[str, Any]: ... # TODO: TypedDict for this
def viridis() -> None: ...
def vlines(
x: Union[Scalar, ArrayLike],
ymin: Union[Scalar, ArrayLike],
ymax: Union[Scalar, ArrayLike],
colors: Optional[Union[_ColorLike, Sequence[_ColorLike]]] = ..., # TODO: This may not be the right type for colors
linestyles: Optional[Literal["solid", "dashed", "dashdot", "dotted"]] = ...,
label: str = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> LineCollection: ...
def waitforbuttonpress(*args: Any, **kwargs: Any) -> None: ...
def winter() -> None: ...
def xcorr(
x: ArrayLike,
y: ArrayLike,
normed: bool = ...,
detrend: _DetrendCallable = ...,
usevlines: bool = ...,
maxlags: int = ...,
*,
data: Optional[Any] = ...,
**kwargs: Any
) -> Tuple[ndarray, ndarray, Union[LineCollection, Line2D], Optional[Line2D]]: ...
def xkcd(scale: float = ..., length: float = ..., randomness: float = ...) -> None: ...
def xlabel(xlabel: str, fontdict: Optional[Dict[Any, Any]] = ..., labelpad: Optional[Scalar] = ..., **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def xlim(*args: Any, **kwargs: Any) -> Tuple[float, float]: ...
def xscale(value: str, **kwargs: Any) -> None: ...
def xticks(ticks: Optional[ArrayLike] = ..., labels: Optional[ArrayLike] = ..., **kwargs: Any) -> Tuple[ArrayLike, List[Text]]: ... # TODO: What is "an array of label locations?
def ylabel(ylabel: str, fontdict: Optional[Dict[Any, Any]] = ..., labelpad: Optional[Scalar] = ..., **kwargs: Any) -> None: ...
# TODO: write overloads for various forms
def ylim(*args: Any, **kwargs: Any) -> Tuple[float, float]: ...
def yscale(value: str, **kwargs: Any) -> None: ...
def yticks(ticks: Optional[ArrayLike] = ..., labels: Optional[ArrayLike] = ..., **kwargs: Any) -> Tuple[ArrayLike, List[Text]]: ... # TODO: What is "an array of label locations?

17
matplotlib/quiver.pyi Normal file
Просмотреть файл

@ -0,0 +1,17 @@
from typing import Any
from matplotlib.artist import Artist
from matplotlib.collections import PolyCollection
class Barbs(PolyCollection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Quiver(PolyCollection):
def __getattr__(self, name: str) -> Any: ... # incomplete
class QuiverKey(Artist):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/rcsetup.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/sankey.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/scale.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/spines.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/stackplot.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,8 @@
from typing import Any
class StreamplotSet:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,16 @@
# COMPLETE
from pathlib import Path
from typing import Any, Dict, List, Mapping, Union
_Style = Union[str, Path, Mapping[str, Any]]
_StyleOrList = Union[_Style, List[_Style]]
def context(style: _StyleOrList, after_reset: bool = ...) -> None: ...
def reload_library() -> None: ...
def use(style: _StyleOrList) -> None: ...
library: Dict[str, Any]
available: List[str]

4
matplotlib/table.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

53
matplotlib/text.pyi Normal file
Просмотреть файл

@ -0,0 +1,53 @@
from pathlib import Path
from typing import Any, Callable, Literal, Optional, Tuple, Union
from matplotlib.artist import Artist
from matplotlib.backend_bases import RendererBase
from matplotlib.colors import _ColorLike
from matplotlib.font_manager import FontProperties
from matplotlib.transforms import Bbox, Transform
class Text(Artist):
def __init__(
self,
x: float = ...,
y: float = ...,
text: str = ...,
color: Optional[_ColorLike] = ...,
verticalalignment: Literal['center', 'top', 'bottom', 'baseline', 'center_baseline'] = ...,
horizontalalignment: Literal['center', 'right', 'left'] = ...,
multialignment: Literal['center', 'right', 'left'] = ...,
fontproperties: Optional[Union[str, Path, FontProperties]] = ...,
rotation: Optional[Union[float, Literal['vertical', 'horizontal']]] = ...,
linespacing: Optional[float] = ...,
rotation_mode: Optional[Literal['default', 'anchor']] = ...,
usetex: Optional[bool] = ...,
wrap: bool = ...,
**kwargs: Any
) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class _AnnotationBase:
def __getattr__(self, name: str) -> Any: ... # incomplete
class Annotation(Text, _AnnotationBase):
def __init__(
self,
text: str,
xy: Tuple[float, float],
xytext: Optional[str] = ...,
xycoords: Union[str, Artist, Transform, Callable[[RendererBase], Union[Bbox, Transform]], Tuple[float, float]] = ...,
**kwargs: Any
) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class OffsetFrom:
def __getattr__(self, name: str) -> Any: ... # incomplete
def get_rotation(rotation: Optional[Union[float, Literal['horizontal', 'vertical']]]) -> float: ...

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/textpath.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

12
matplotlib/ticker.pyi Normal file
Просмотреть файл

@ -0,0 +1,12 @@
from typing import Any
class TickHelper:
def __getattr__(self, name: str) -> Any: ... # incomplete
class Formatter(TickHelper):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Locator(TickHelper):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

27
matplotlib/transforms.pyi Normal file
Просмотреть файл

@ -0,0 +1,27 @@
from typing import Any
from matplotlib._typing import ArrayLike
class TransformNode:
def __getattr__(self, name: str) -> Any: ... # incomplete
class BboxBase(TransformNode):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Bbox(BboxBase):
def __init__(self, points: ArrayLike, **kwargs: Any) -> None: ...
@staticmethod
def from_bounds(x0: int, y0: int, width: int, height: int) -> Bbox: ...
def __getattr__(self, name: str) -> Any: ... # incomplete
class Transform(TransformNode):
def __getattr__(self, name: str) -> Any: ... # incomplete
class Affine2D:
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete

Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/type1font.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

4
matplotlib/units.pyi Normal file
Просмотреть файл

@ -0,0 +1,4 @@
from typing import Any
def __getattr__(name: str) -> Any: ... # incomplete

11
matplotlib/widgets.pyi Normal file
Просмотреть файл

@ -0,0 +1,11 @@
from typing import Any
class Widget:
def __getattr__(self, name: str) -> Any: ... # incomplete
class SubplotTool(Widget):
def __getattr__(self, name: str) -> Any: ... # incomplete
def __getattr__(name: str) -> Any: ... # incomplete