container.pyi 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. from matplotlib.artist import Artist
  2. from matplotlib.lines import Line2D
  3. from matplotlib.collections import LineCollection
  4. from matplotlib.patches import Rectangle
  5. from collections.abc import Callable
  6. from typing import Any, Literal
  7. from numpy.typing import ArrayLike
  8. class Container(tuple):
  9. def __new__(cls, *args, **kwargs): ...
  10. def __init__(self, kl, label: Any | None = ...) -> None: ...
  11. def remove(self) -> None: ...
  12. def get_children(self) -> list[Artist]: ...
  13. def get_label(self) -> str | None: ...
  14. def set_label(self, s: Any) -> None: ...
  15. def add_callback(self, func: Callable[[Artist], Any]) -> int: ...
  16. def remove_callback(self, oid: int) -> None: ...
  17. def pchanged(self) -> None: ...
  18. class BarContainer(Container):
  19. patches: list[Rectangle]
  20. errorbar: None | ErrorbarContainer
  21. datavalues: None | ArrayLike
  22. orientation: None | Literal["vertical", "horizontal"]
  23. def __init__(
  24. self,
  25. patches: list[Rectangle],
  26. errorbar: ErrorbarContainer | None = ...,
  27. *,
  28. datavalues: ArrayLike | None = ...,
  29. orientation: Literal["vertical", "horizontal"] | None = ...,
  30. **kwargs
  31. ) -> None: ...
  32. class ErrorbarContainer(Container):
  33. lines: tuple[Line2D, Line2D, LineCollection]
  34. has_xerr: bool
  35. has_yerr: bool
  36. def __init__(
  37. self,
  38. lines: tuple[Line2D, Line2D, LineCollection],
  39. has_xerr: bool = ...,
  40. has_yerr: bool = ...,
  41. **kwargs
  42. ) -> None: ...
  43. class StemContainer(Container):
  44. markerline: Line2D
  45. stemlines: LineCollection
  46. baseline: Line2D
  47. def __init__(
  48. self,
  49. markerline_stemlines_baseline: tuple[Line2D, LineCollection, Line2D],
  50. **kwargs
  51. ) -> None: ...