polar.pyi 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. import matplotlib.axis as maxis
  2. import matplotlib.ticker as mticker
  3. import matplotlib.transforms as mtransforms
  4. from matplotlib.axes import Axes
  5. from matplotlib.lines import Line2D
  6. from matplotlib.text import Text
  7. import numpy as np
  8. from numpy.typing import ArrayLike
  9. from collections.abc import Sequence
  10. from typing import Any, ClassVar, Literal, overload
  11. class PolarTransform(mtransforms.Transform):
  12. input_dims: int
  13. output_dims: int
  14. def __init__(
  15. self,
  16. axis: PolarAxes | None = ...,
  17. use_rmin: bool = ...,
  18. _apply_theta_transforms: bool = ...,
  19. *,
  20. scale_transform: mtransforms.Transform | None = ...,
  21. ) -> None: ...
  22. def inverted(self) -> InvertedPolarTransform: ...
  23. class PolarAffine(mtransforms.Affine2DBase):
  24. def __init__(
  25. self, scale_transform: mtransforms.Transform, limits: mtransforms.BboxBase
  26. ) -> None: ...
  27. class InvertedPolarTransform(mtransforms.Transform):
  28. input_dims: int
  29. output_dims: int
  30. def __init__(
  31. self,
  32. axis: PolarAxes | None = ...,
  33. use_rmin: bool = ...,
  34. _apply_theta_transforms: bool = ...,
  35. ) -> None: ...
  36. def inverted(self) -> PolarTransform: ...
  37. class ThetaFormatter(mticker.Formatter): ...
  38. class _AxisWrapper:
  39. def __init__(self, axis: maxis.Axis) -> None: ...
  40. def get_view_interval(self) -> np.ndarray: ...
  41. def set_view_interval(self, vmin: float, vmax: float) -> None: ...
  42. def get_minpos(self) -> float: ...
  43. def get_data_interval(self) -> np.ndarray: ...
  44. def set_data_interval(self, vmin: float, vmax: float) -> None: ...
  45. def get_tick_space(self) -> int: ...
  46. class ThetaLocator(mticker.Locator):
  47. base: mticker.Locator
  48. axis: _AxisWrapper | None
  49. def __init__(self, base: mticker.Locator) -> None: ...
  50. class ThetaTick(maxis.XTick):
  51. def __init__(self, axes: PolarAxes, *args, **kwargs) -> None: ...
  52. class ThetaAxis(maxis.XAxis):
  53. axis_name: str
  54. class RadialLocator(mticker.Locator):
  55. base: mticker.Locator
  56. def __init__(self, base, axes: PolarAxes | None = ...) -> None: ...
  57. class RadialTick(maxis.YTick): ...
  58. class RadialAxis(maxis.YAxis):
  59. axis_name: str
  60. class _WedgeBbox(mtransforms.Bbox):
  61. def __init__(
  62. self,
  63. center: tuple[float, float],
  64. viewLim: mtransforms.Bbox,
  65. originLim: mtransforms.Bbox,
  66. **kwargs,
  67. ) -> None: ...
  68. class PolarAxes(Axes):
  69. PolarTransform: ClassVar[type] = PolarTransform
  70. PolarAffine: ClassVar[type] = PolarAffine
  71. InvertedPolarTransform: ClassVar[type] = InvertedPolarTransform
  72. ThetaFormatter: ClassVar[type] = ThetaFormatter
  73. RadialLocator: ClassVar[type] = RadialLocator
  74. ThetaLocator: ClassVar[type] = ThetaLocator
  75. name: str
  76. use_sticky_edges: bool
  77. def __init__(
  78. self,
  79. *args,
  80. theta_offset: float = ...,
  81. theta_direction: float = ...,
  82. rlabel_position: float = ...,
  83. **kwargs,
  84. ) -> None: ...
  85. def get_xaxis_transform(
  86. self, which: Literal["tick1", "tick2", "grid"] = ...
  87. ) -> mtransforms.Transform: ...
  88. def get_xaxis_text1_transform(
  89. self, pad: float
  90. ) -> tuple[
  91. mtransforms.Transform,
  92. Literal["center", "top", "bottom", "baseline", "center_baseline"],
  93. Literal["center", "left", "right"],
  94. ]: ...
  95. def get_xaxis_text2_transform(
  96. self, pad: float
  97. ) -> tuple[
  98. mtransforms.Transform,
  99. Literal["center", "top", "bottom", "baseline", "center_baseline"],
  100. Literal["center", "left", "right"],
  101. ]: ...
  102. def get_yaxis_transform(
  103. self, which: Literal["tick1", "tick2", "grid"] = ...
  104. ) -> mtransforms.Transform: ...
  105. def get_yaxis_text1_transform(
  106. self, pad: float
  107. ) -> tuple[
  108. mtransforms.Transform,
  109. Literal["center", "top", "bottom", "baseline", "center_baseline"],
  110. Literal["center", "left", "right"],
  111. ]: ...
  112. def get_yaxis_text2_transform(
  113. self, pad: float
  114. ) -> tuple[
  115. mtransforms.Transform,
  116. Literal["center", "top", "bottom", "baseline", "center_baseline"],
  117. Literal["center", "left", "right"],
  118. ]: ...
  119. def set_thetamax(self, thetamax: float) -> None: ...
  120. def get_thetamax(self) -> float: ...
  121. def set_thetamin(self, thetamin: float) -> None: ...
  122. def get_thetamin(self) -> float: ...
  123. @overload
  124. def set_thetalim(self, minval: float, maxval: float, /) -> tuple[float, float]: ...
  125. @overload
  126. def set_thetalim(self, *, thetamin: float, thetamax: float) -> tuple[float, float]: ...
  127. def set_theta_offset(self, offset: float) -> None: ...
  128. def get_theta_offset(self) -> float: ...
  129. def set_theta_zero_location(
  130. self,
  131. loc: Literal["N", "NW", "W", "SW", "S", "SE", "E", "NE"],
  132. offset: float = ...,
  133. ) -> None: ...
  134. def set_theta_direction(
  135. self,
  136. direction: Literal[-1, 1, "clockwise", "counterclockwise", "anticlockwise"],
  137. ) -> None: ...
  138. def get_theta_direction(self) -> Literal[-1, 1]: ...
  139. def set_rmax(self, rmax: float) -> None: ...
  140. def get_rmax(self) -> float: ...
  141. def set_rmin(self, rmin: float) -> None: ...
  142. def get_rmin(self) -> float: ...
  143. def set_rorigin(self, rorigin: float | None) -> None: ...
  144. def get_rorigin(self) -> float: ...
  145. def get_rsign(self) -> float: ...
  146. def set_rlim(
  147. self,
  148. bottom: float | tuple[float, float] | None = ...,
  149. top: float | None = ...,
  150. *,
  151. emit: bool = ...,
  152. auto: bool = ...,
  153. **kwargs,
  154. ) -> tuple[float, float]: ...
  155. def get_rlabel_position(self) -> float: ...
  156. def set_rlabel_position(self, value: float) -> None: ...
  157. def set_rscale(self, *args, **kwargs) -> None: ...
  158. def set_rticks(self, *args, **kwargs) -> None: ...
  159. def set_thetagrids(
  160. self,
  161. angles: ArrayLike,
  162. labels: Sequence[str | Text] | None = ...,
  163. fmt: str | None = ...,
  164. **kwargs,
  165. ) -> tuple[list[Line2D], list[Text]]: ...
  166. def set_rgrids(
  167. self,
  168. radii: ArrayLike,
  169. labels: Sequence[str | Text] | None = ...,
  170. angle: float | None = ...,
  171. fmt: str | None = ...,
  172. **kwargs,
  173. ) -> tuple[list[Line2D], list[Text]]: ...
  174. def format_coord(self, theta: float, r: float) -> str: ...
  175. def get_data_ratio(self) -> float: ...
  176. def can_zoom(self) -> bool: ...
  177. def can_pan(self) -> bool: ...
  178. def start_pan(self, x: float, y: float, button: int) -> None: ...
  179. def end_pan(self) -> None: ...
  180. def drag_pan(self, button: Any, key: Any, x: float, y: float) -> None: ...