quiver.pyi 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import matplotlib.artist as martist
  2. import matplotlib.collections as mcollections
  3. from matplotlib.axes import Axes
  4. from matplotlib.figure import Figure, SubFigure
  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. zorder: float | None = ...,
  46. **kwargs
  47. ) -> None: ...
  48. @property
  49. def labelsep(self) -> float: ...
  50. def set_figure(self, fig: Figure | SubFigure) -> None: ...
  51. class Quiver(mcollections.PolyCollection):
  52. X: ArrayLike
  53. Y: ArrayLike
  54. XY: ArrayLike
  55. U: ArrayLike
  56. V: ArrayLike
  57. Umask: ArrayLike
  58. N: int
  59. scale: float | None
  60. headwidth: float
  61. headlength: float
  62. headaxislength: float
  63. minshaft: float
  64. minlength: float
  65. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  66. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] | None
  67. angles: Literal["uv", "xy"] | ArrayLike
  68. width: float | None
  69. pivot: Literal["tail", "middle", "tip"]
  70. transform: Transform
  71. polykw: dict[str, Any]
  72. @overload
  73. def __init__(
  74. self,
  75. ax: Axes,
  76. U: ArrayLike,
  77. V: ArrayLike,
  78. C: ArrayLike = ...,
  79. *,
  80. scale: float | None = ...,
  81. headwidth: float = ...,
  82. headlength: float = ...,
  83. headaxislength: float = ...,
  84. minshaft: float = ...,
  85. minlength: float = ...,
  86. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
  87. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  88. | None = ...,
  89. angles: Literal["uv", "xy"] | ArrayLike = ...,
  90. width: float | None = ...,
  91. color: ColorType | Sequence[ColorType] = ...,
  92. pivot: Literal["tail", "mid", "middle", "tip"] = ...,
  93. **kwargs
  94. ) -> None: ...
  95. @overload
  96. def __init__(
  97. self,
  98. ax: Axes,
  99. X: ArrayLike,
  100. Y: ArrayLike,
  101. U: ArrayLike,
  102. V: ArrayLike,
  103. C: ArrayLike = ...,
  104. *,
  105. scale: float | None = ...,
  106. headwidth: float = ...,
  107. headlength: float = ...,
  108. headaxislength: float = ...,
  109. minshaft: float = ...,
  110. minlength: float = ...,
  111. units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
  112. scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
  113. | None = ...,
  114. angles: Literal["uv", "xy"] | ArrayLike = ...,
  115. width: float | None = ...,
  116. color: ColorType | Sequence[ColorType] = ...,
  117. pivot: Literal["tail", "mid", "middle", "tip"] = ...,
  118. **kwargs
  119. ) -> None: ...
  120. def get_datalim(self, transData: Transform) -> Bbox: ...
  121. def set_UVC(
  122. self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
  123. ) -> None: ...
  124. class Barbs(mcollections.PolyCollection):
  125. sizes: dict[str, float]
  126. fill_empty: bool
  127. barb_increments: dict[str, float]
  128. rounding: bool
  129. flip: np.ndarray
  130. x: ArrayLike
  131. y: ArrayLike
  132. u: ArrayLike
  133. v: ArrayLike
  134. @overload
  135. def __init__(
  136. self,
  137. ax: Axes,
  138. U: ArrayLike,
  139. V: ArrayLike,
  140. C: ArrayLike = ...,
  141. *,
  142. pivot: str = ...,
  143. length: int = ...,
  144. barbcolor: ColorType | Sequence[ColorType] | None = ...,
  145. flagcolor: ColorType | Sequence[ColorType] | None = ...,
  146. sizes: dict[str, float] | None = ...,
  147. fill_empty: bool = ...,
  148. barb_increments: dict[str, float] | None = ...,
  149. rounding: bool = ...,
  150. flip_barb: bool | ArrayLike = ...,
  151. **kwargs
  152. ) -> None: ...
  153. @overload
  154. def __init__(
  155. self,
  156. ax: Axes,
  157. X: ArrayLike,
  158. Y: ArrayLike,
  159. U: ArrayLike,
  160. V: ArrayLike,
  161. C: ArrayLike = ...,
  162. *,
  163. pivot: str = ...,
  164. length: int = ...,
  165. barbcolor: ColorType | Sequence[ColorType] | None = ...,
  166. flagcolor: ColorType | Sequence[ColorType] | None = ...,
  167. sizes: dict[str, float] | None = ...,
  168. fill_empty: bool = ...,
  169. barb_increments: dict[str, float] | None = ...,
  170. rounding: bool = ...,
  171. flip_barb: bool | ArrayLike = ...,
  172. **kwargs
  173. ) -> None: ...
  174. def set_UVC(
  175. self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
  176. ) -> None: ...
  177. def set_offsets(self, xy: ArrayLike) -> None: ...