scale.pyi 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. from matplotlib.axis import Axis
  2. from matplotlib.transforms import Transform
  3. from collections.abc import Callable, Iterable
  4. from typing import Literal
  5. from numpy.typing import ArrayLike
  6. class ScaleBase:
  7. def __init__(self, axis: Axis | None) -> None: ...
  8. def get_transform(self) -> Transform: ...
  9. def set_default_locators_and_formatters(self, axis: Axis) -> None: ...
  10. def limit_range_for_scale(
  11. self, vmin: float, vmax: float, minpos: float
  12. ) -> tuple[float, float]: ...
  13. class LinearScale(ScaleBase):
  14. name: str
  15. class FuncTransform(Transform):
  16. input_dims: int
  17. output_dims: int
  18. def __init__(
  19. self,
  20. forward: Callable[[ArrayLike], ArrayLike],
  21. inverse: Callable[[ArrayLike], ArrayLike],
  22. ) -> None: ...
  23. def inverted(self) -> FuncTransform: ...
  24. class FuncScale(ScaleBase):
  25. name: str
  26. def __init__(
  27. self,
  28. axis: Axis | None,
  29. functions: tuple[
  30. Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
  31. ],
  32. ) -> None: ...
  33. class LogTransform(Transform):
  34. input_dims: int
  35. output_dims: int
  36. base: float
  37. def __init__(
  38. self, base: float, nonpositive: Literal["clip", "mask"] = ...
  39. ) -> None: ...
  40. def inverted(self) -> InvertedLogTransform: ...
  41. class InvertedLogTransform(Transform):
  42. input_dims: int
  43. output_dims: int
  44. base: float
  45. def __init__(self, base: float) -> None: ...
  46. def inverted(self) -> LogTransform: ...
  47. class LogScale(ScaleBase):
  48. name: str
  49. subs: Iterable[int] | None
  50. def __init__(
  51. self,
  52. axis: Axis | None,
  53. *,
  54. base: float = ...,
  55. subs: Iterable[int] | None = ...,
  56. nonpositive: Literal["clip", "mask"] = ...
  57. ) -> None: ...
  58. @property
  59. def base(self) -> float: ...
  60. def get_transform(self) -> Transform: ...
  61. class FuncScaleLog(LogScale):
  62. def __init__(
  63. self,
  64. axis: Axis | None,
  65. functions: tuple[
  66. Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
  67. ],
  68. base: float = ...,
  69. ) -> None: ...
  70. @property
  71. def base(self) -> float: ...
  72. def get_transform(self) -> Transform: ...
  73. class SymmetricalLogTransform(Transform):
  74. input_dims: int
  75. output_dims: int
  76. base: float
  77. linthresh: float
  78. linscale: float
  79. def __init__(self, base: float, linthresh: float, linscale: float) -> None: ...
  80. def inverted(self) -> InvertedSymmetricalLogTransform: ...
  81. class InvertedSymmetricalLogTransform(Transform):
  82. input_dims: int
  83. output_dims: int
  84. base: float
  85. linthresh: float
  86. invlinthresh: float
  87. linscale: float
  88. def __init__(self, base: float, linthresh: float, linscale: float) -> None: ...
  89. def inverted(self) -> SymmetricalLogTransform: ...
  90. class SymmetricalLogScale(ScaleBase):
  91. name: str
  92. subs: Iterable[int] | None
  93. def __init__(
  94. self,
  95. axis: Axis | None,
  96. *,
  97. base: float = ...,
  98. linthresh: float = ...,
  99. subs: Iterable[int] | None = ...,
  100. linscale: float = ...
  101. ) -> None: ...
  102. @property
  103. def base(self) -> float: ...
  104. @property
  105. def linthresh(self) -> float: ...
  106. @property
  107. def linscale(self) -> float: ...
  108. def get_transform(self) -> SymmetricalLogTransform: ...
  109. class AsinhTransform(Transform):
  110. input_dims: int
  111. output_dims: int
  112. linear_width: float
  113. def __init__(self, linear_width: float) -> None: ...
  114. def inverted(self) -> InvertedAsinhTransform: ...
  115. class InvertedAsinhTransform(Transform):
  116. input_dims: int
  117. output_dims: int
  118. linear_width: float
  119. def __init__(self, linear_width: float) -> None: ...
  120. def inverted(self) -> AsinhTransform: ...
  121. class AsinhScale(ScaleBase):
  122. name: str
  123. auto_tick_multipliers: dict[int, tuple[int, ...]]
  124. def __init__(
  125. self,
  126. axis: Axis | None,
  127. *,
  128. linear_width: float = ...,
  129. base: float = ...,
  130. subs: Iterable[int] | Literal["auto"] | None = ...,
  131. **kwargs
  132. ) -> None: ...
  133. @property
  134. def linear_width(self) -> float: ...
  135. def get_transform(self) -> AsinhTransform: ...
  136. class LogitTransform(Transform):
  137. input_dims: int
  138. output_dims: int
  139. def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ...
  140. def inverted(self) -> LogisticTransform: ...
  141. class LogisticTransform(Transform):
  142. input_dims: int
  143. output_dims: int
  144. def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ...
  145. def inverted(self) -> LogitTransform: ...
  146. class LogitScale(ScaleBase):
  147. name: str
  148. def __init__(
  149. self,
  150. axis: Axis | None,
  151. nonpositive: Literal["mask", "clip"] = ...,
  152. *,
  153. one_half: str = ...,
  154. use_overline: bool = ...
  155. ) -> None: ...
  156. def get_transform(self) -> LogitTransform: ...
  157. def get_scale_names() -> list[str]: ...
  158. def scale_factory(scale: str, axis: Axis, **kwargs) -> ScaleBase: ...
  159. def register_scale(scale_class: type[ScaleBase]) -> None: ...