streamplot.pyi 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. from matplotlib.axes import Axes
  2. from matplotlib.colors import Normalize, Colormap
  3. from matplotlib.collections import LineCollection, PatchCollection
  4. from matplotlib.patches import ArrowStyle
  5. from matplotlib.transforms import Transform
  6. from typing import Literal
  7. from numpy.typing import ArrayLike
  8. from .typing import ColorType
  9. def streamplot(
  10. axes: Axes,
  11. x: ArrayLike,
  12. y: ArrayLike,
  13. u: ArrayLike,
  14. v: ArrayLike,
  15. density: float | tuple[float, float] = ...,
  16. linewidth: float | ArrayLike | None = ...,
  17. color: ColorType | ArrayLike | None = ...,
  18. cmap: str | Colormap | None = ...,
  19. norm: str | Normalize | None = ...,
  20. arrowsize: float = ...,
  21. arrowstyle: str | ArrowStyle = ...,
  22. minlength: float = ...,
  23. transform: Transform | None = ...,
  24. zorder: float | None = ...,
  25. start_points: ArrayLike | None = ...,
  26. maxlength: float = ...,
  27. integration_direction: Literal["forward", "backward", "both"] = ...,
  28. broken_streamlines: bool = ...,
  29. ) -> StreamplotSet: ...
  30. class StreamplotSet:
  31. lines: LineCollection
  32. arrows: PatchCollection
  33. def __init__(self, lines: LineCollection, arrows: PatchCollection) -> None: ...
  34. class DomainMap:
  35. grid: Grid
  36. mask: StreamMask
  37. x_grid2mask: float
  38. y_grid2mask: float
  39. x_mask2grid: float
  40. y_mask2grid: float
  41. x_data2grid: float
  42. y_data2grid: float
  43. def __init__(self, grid: Grid, mask: StreamMask) -> None: ...
  44. def grid2mask(self, xi: float, yi: float) -> tuple[int, int]: ...
  45. def mask2grid(self, xm: float, ym: float) -> tuple[float, float]: ...
  46. def data2grid(self, xd: float, yd: float) -> tuple[float, float]: ...
  47. def grid2data(self, xg: float, yg: float) -> tuple[float, float]: ...
  48. def start_trajectory(
  49. self, xg: float, yg: float, broken_streamlines: bool = ...
  50. ) -> None: ...
  51. def reset_start_point(self, xg: float, yg: float) -> None: ...
  52. def update_trajectory(self, xg, yg, broken_streamlines: bool = ...) -> None: ...
  53. def undo_trajectory(self) -> None: ...
  54. class Grid:
  55. nx: int
  56. ny: int
  57. dx: float
  58. dy: float
  59. x_origin: float
  60. y_origin: float
  61. width: float
  62. height: float
  63. def __init__(self, x: ArrayLike, y: ArrayLike) -> None: ...
  64. @property
  65. def shape(self) -> tuple[int, int]: ...
  66. def within_grid(self, xi: float, yi: float) -> bool: ...
  67. class StreamMask:
  68. nx: int
  69. ny: int
  70. shape: tuple[int, int]
  71. def __init__(self, density: float | tuple[float, float]) -> None: ...
  72. def __getitem__(self, args): ...
  73. class InvalidIndexError(Exception): ...
  74. class TerminateTrajectory(Exception): ...
  75. class OutOfBounds(IndexError): ...