quiver.pyi 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. import matplotlib.artist as martist
  2. import matplotlib.collections as mcollections
  3. from matplotlib.axes import Axes
  4. from matplotlib.figure import Figure
  5. from matplotlib.text import Text
  6. from matplotlib.transforms import Transform, Bbox
  7. import numpy as np
  8. from numpy.typing import ArrayLike
  9. from collections.abc import Sequence
  10. from typing import Any, Literal, overload
  11. from matplotlib.typing import ColorType
  12. class QuiverKey(martist.Artist):
  13. halign: dict[Literal["N", "S", "E", "W"], Literal["left", "center", "right"]]
  14. valign: dict[Literal["N", "S", "E", "W"], Literal["top", "center", "bottom"]]
  15. pivot: dict[Literal["N", "S", "E", "W"], Literal["middle", "tip", "tail"]]
  16. Q: Quiver
  17. X: float
  18. Y: float
  19. U: float
  20. angle: float
  21. coord: Literal["axes", "figure", "data", "inches"]
  22. color: ColorType | None
  23. label: str
  24. labelpos: Literal["N", "S", "E", "W"]
  25. labelcolor: ColorType | None
  26. fontproperties: dict[str, Any]
  27. kw: dict[str, Any]
  28. text: Text
  29. zorder: float
  30. def __init__(
  31. self,
  32. Q: Quiver,
  33. X: float,
  34. Y: float,
  35. U: float,
  36. label: str,
  37. *,
  38. angle: float = ...,
  39. coordinates: Literal["axes", "figure", "data", "inches"] = ...,
  40. color: ColorType | None = ...,
  41. labelsep: float = ...,
  42. labelpos: Literal["N", "S", "E", "W"] = ...,
  43. labelcolor: ColorType | None = ...,
  44. fontproperties: dict[str, Any] | None = ...,
  45. **kwargs
  46. ) -> None: ...
  47. @property
  48. def labelsep(self) -> float: ...
  49. def set_figure(self, fig: Figure) -> None: ...
  50. class Quiver(mcollections.PolyCollection):
  51. X: ArrayLike
  52. Y: ArrayLike
  53. XY: ArrayLike
  54. U: ArrayLike
  55. V: ArrayLike
  56. Umask: ArrayLike
  57. N: int
  58. scale: float | None
  59. headwidth: float
  60. headlength: float
  61. headaxislength: float
  62. minshaft: float
  63. minlength: float
  64. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  65. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] | None
  66. angles: Literal["uv", "xy"] | ArrayLike
  67. width: float | None
  68. pivot: Literal["tail", "middle", "tip"]
  69. transform: Transform
  70. polykw: dict[str, Any]
  71. @overload
  72. def __init__(
  73. self,
  74. ax: Axes,
  75. U: ArrayLike,
  76. V: ArrayLike,
  77. C: ArrayLike = ...,
  78. *,
  79. scale: float | None = ...,
  80. headwidth: float = ...,
  81. headlength: float = ...,
  82. headaxislength: float = ...,
  83. minshaft: float = ...,
  84. minlength: float = ...,
  85. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
  86. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  87. | None = ...,
  88. angles: Literal["uv", "xy"] | ArrayLike = ...,
  89. width: float | None = ...,
  90. color: ColorType | Sequence[ColorType] = ...,
  91. pivot: Literal["tail", "mid", "middle", "tip"] = ...,
  92. **kwargs
  93. ) -> None: ...
  94. @overload
  95. def __init__(
  96. self,
  97. ax: Axes,
  98. X: ArrayLike,
  99. Y: ArrayLike,
  100. U: ArrayLike,
  101. V: ArrayLike,
  102. C: ArrayLike = ...,
  103. *,
  104. scale: float | None = ...,
  105. headwidth: float = ...,
  106. headlength: float = ...,
  107. headaxislength: float = ...,
  108. minshaft: float = ...,
  109. minlength: float = ...,
  110. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
  111. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  112. | None = ...,
  113. angles: Literal["uv", "xy"] | ArrayLike = ...,
  114. width: float | None = ...,
  115. color: ColorType | Sequence[ColorType] = ...,
  116. pivot: Literal["tail", "mid", "middle", "tip"] = ...,
  117. **kwargs
  118. ) -> None: ...
  119. def get_datalim(self, transData: Transform) -> Bbox: ...
  120. def set_UVC(
  121. self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
  122. ) -> None: ...
  123. @property
  124. def quiver_doc(self) -> str: ...
  125. class Barbs(mcollections.PolyCollection):
  126. sizes: dict[str, float]
  127. fill_empty: bool
  128. barb_increments: dict[str, float]
  129. rounding: bool
  130. flip: np.ndarray
  131. x: ArrayLike
  132. y: ArrayLike
  133. u: ArrayLike
  134. v: ArrayLike
  135. @overload
  136. def __init__(
  137. self,
  138. ax: Axes,
  139. U: ArrayLike,
  140. V: ArrayLike,
  141. C: ArrayLike = ...,
  142. *,
  143. pivot: str = ...,
  144. length: int = ...,
  145. barbcolor: ColorType | Sequence[ColorType] | None = ...,
  146. flagcolor: ColorType | Sequence[ColorType] | None = ...,
  147. sizes: dict[str, float] | None = ...,
  148. fill_empty: bool = ...,
  149. barb_increments: dict[str, float] | None = ...,
  150. rounding: bool = ...,
  151. flip_barb: bool | ArrayLike = ...,
  152. **kwargs
  153. ) -> None: ...
  154. @overload
  155. def __init__(
  156. self,
  157. ax: Axes,
  158. X: ArrayLike,
  159. Y: ArrayLike,
  160. U: ArrayLike,
  161. V: ArrayLike,
  162. C: ArrayLike = ...,
  163. *,
  164. pivot: str = ...,
  165. length: int = ...,
  166. barbcolor: ColorType | Sequence[ColorType] | None = ...,
  167. flagcolor: ColorType | Sequence[ColorType] | None = ...,
  168. sizes: dict[str, float] | None = ...,
  169. fill_empty: bool = ...,
  170. barb_increments: dict[str, float] | None = ...,
  171. rounding: bool = ...,
  172. flip_barb: bool | ArrayLike = ...,
  173. **kwargs
  174. ) -> None: ...
  175. def set_UVC(
  176. self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
  177. ) -> None: ...
  178. def set_offsets(self, xy: ArrayLike) -> None: ...
  179. @property
  180. def barbs_doc(self) -> str: ...