patheffects.pyi 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. from collections.abc import Iterable, Sequence
  2. from typing import Any
  3. from matplotlib.backend_bases import RendererBase, GraphicsContextBase
  4. from matplotlib.path import Path
  5. from matplotlib.patches import Patch
  6. from matplotlib.transforms import Transform
  7. from matplotlib.typing import ColorType
  8. class AbstractPathEffect:
  9. def __init__(self, offset: tuple[float, float] = ...) -> None: ...
  10. def draw_path(
  11. self,
  12. renderer: RendererBase,
  13. gc: GraphicsContextBase,
  14. tpath: Path,
  15. affine: Transform,
  16. rgbFace: ColorType | None = ...,
  17. ) -> None: ...
  18. class PathEffectRenderer(RendererBase):
  19. def __init__(
  20. self, path_effects: Iterable[AbstractPathEffect], renderer: RendererBase
  21. ) -> None: ...
  22. def copy_with_path_effect(self, path_effects: Iterable[AbstractPathEffect]) -> PathEffectRenderer: ...
  23. def draw_path(
  24. self,
  25. gc: GraphicsContextBase,
  26. tpath: Path,
  27. affine: Transform,
  28. rgbFace: ColorType | None = ...,
  29. ) -> None: ...
  30. def draw_markers(
  31. self,
  32. gc: GraphicsContextBase,
  33. marker_path: Path,
  34. marker_trans: Transform,
  35. path: Path,
  36. *args,
  37. **kwargs
  38. ) -> None: ...
  39. def draw_path_collection(
  40. self,
  41. gc: GraphicsContextBase,
  42. master_transform: Transform,
  43. paths: Sequence[Path],
  44. *args,
  45. **kwargs
  46. ) -> None: ...
  47. def __getattribute__(self, name: str) -> Any: ...
  48. class Normal(AbstractPathEffect): ...
  49. class Stroke(AbstractPathEffect):
  50. def __init__(self, offset: tuple[float, float] = ..., **kwargs) -> None: ...
  51. # rgbFace becomes non-optional
  52. def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore
  53. class withStroke(Stroke): ...
  54. class SimplePatchShadow(AbstractPathEffect):
  55. def __init__(
  56. self,
  57. offset: tuple[float, float] = ...,
  58. shadow_rgbFace: ColorType | None = ...,
  59. alpha: float | None = ...,
  60. rho: float = ...,
  61. **kwargs
  62. ) -> None: ...
  63. # rgbFace becomes non-optional
  64. def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore
  65. class withSimplePatchShadow(SimplePatchShadow): ...
  66. class SimpleLineShadow(AbstractPathEffect):
  67. def __init__(
  68. self,
  69. offset: tuple[float, float] = ...,
  70. shadow_color: ColorType = ...,
  71. alpha: float = ...,
  72. rho: float = ...,
  73. **kwargs
  74. ) -> None: ...
  75. # rgbFace becomes non-optional
  76. def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore
  77. class PathPatchEffect(AbstractPathEffect):
  78. patch: Patch
  79. def __init__(self, offset: tuple[float, float] = ..., **kwargs) -> None: ...
  80. # rgbFace becomes non-optional
  81. def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore
  82. class TickedStroke(AbstractPathEffect):
  83. def __init__(
  84. self,
  85. offset: tuple[float, float] = ...,
  86. spacing: float = ...,
  87. angle: float = ...,
  88. length: float = ...,
  89. **kwargs
  90. ) -> None: ...
  91. # rgbFace becomes non-optional
  92. def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore
  93. class withTickedStroke(TickedStroke): ...