__init__.pyi 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. __all__ = [
  2. "__bibtex__",
  3. "__version__",
  4. "__version_info__",
  5. "set_loglevel",
  6. "ExecutableNotFoundError",
  7. "get_configdir",
  8. "get_cachedir",
  9. "get_data_path",
  10. "matplotlib_fname",
  11. "MatplotlibDeprecationWarning",
  12. "RcParams",
  13. "rc_params",
  14. "rc_params_from_file",
  15. "rcParamsDefault",
  16. "rcParams",
  17. "rcParamsOrig",
  18. "defaultParams",
  19. "rc",
  20. "rcdefaults",
  21. "rc_file_defaults",
  22. "rc_file",
  23. "rc_context",
  24. "use",
  25. "get_backend",
  26. "interactive",
  27. "is_interactive",
  28. "colormaps",
  29. "color_sequences",
  30. ]
  31. import os
  32. from pathlib import Path
  33. from collections.abc import Callable, Generator
  34. import contextlib
  35. from packaging.version import Version
  36. from matplotlib._api import MatplotlibDeprecationWarning
  37. from typing import Any, NamedTuple
  38. class _VersionInfo(NamedTuple):
  39. major: int
  40. minor: int
  41. micro: int
  42. releaselevel: str
  43. serial: int
  44. __bibtex__: str
  45. __version__: str
  46. __version_info__: _VersionInfo
  47. def set_loglevel(level: str) -> None: ...
  48. class _ExecInfo(NamedTuple):
  49. executable: str
  50. raw_version: str
  51. version: Version
  52. class ExecutableNotFoundError(FileNotFoundError): ...
  53. def _get_executable_info(name: str) -> _ExecInfo: ...
  54. def get_configdir() -> str: ...
  55. def get_cachedir() -> str: ...
  56. def get_data_path() -> str: ...
  57. def matplotlib_fname() -> str: ...
  58. class RcParams(dict[str, Any]):
  59. validate: dict[str, Callable]
  60. def __init__(self, *args, **kwargs) -> None: ...
  61. def __setitem__(self, key: str, val: Any) -> None: ...
  62. def __getitem__(self, key: str) -> Any: ...
  63. def __iter__(self) -> Generator[str, None, None]: ...
  64. def __len__(self) -> int: ...
  65. def find_all(self, pattern: str) -> RcParams: ...
  66. def copy(self) -> RcParams: ...
  67. def rc_params(fail_on_error: bool = ...) -> RcParams: ...
  68. def rc_params_from_file(
  69. fname: str | Path | os.PathLike,
  70. fail_on_error: bool = ...,
  71. use_default_template: bool = ...,
  72. ) -> RcParams: ...
  73. rcParamsDefault: RcParams
  74. rcParams: RcParams
  75. rcParamsOrig: RcParams
  76. defaultParams: dict[str, Any]
  77. def rc(group: str, **kwargs) -> None: ...
  78. def rcdefaults() -> None: ...
  79. def rc_file_defaults() -> None: ...
  80. def rc_file(
  81. fname: str | Path | os.PathLike, *, use_default_template: bool = ...
  82. ) -> None: ...
  83. @contextlib.contextmanager
  84. def rc_context(
  85. rc: dict[str, Any] | None = ..., fname: str | Path | os.PathLike | None = ...
  86. ) -> Generator[None, None, None]: ...
  87. def use(backend: str, *, force: bool = ...) -> None: ...
  88. def get_backend() -> str: ...
  89. def interactive(b: bool) -> None: ...
  90. def is_interactive() -> bool: ...
  91. def _preprocess_data(
  92. func: Callable | None = ...,
  93. *,
  94. replace_names: list[str] | None = ...,
  95. label_namer: str | None = ...
  96. ) -> Callable: ...
  97. from matplotlib.cm import _colormaps as colormaps
  98. from matplotlib.colors import _color_sequences as color_sequences