lines.pyi 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. from .artist import Artist
  2. from .axes import Axes
  3. from .backend_bases import MouseEvent, FigureCanvasBase
  4. from .path import Path
  5. from .transforms import Bbox, Transform
  6. from collections.abc import Callable, Sequence
  7. from typing import Any, Literal, overload
  8. from .typing import (
  9. ColorType,
  10. DrawStyleType,
  11. FillStyleType,
  12. LineStyleType,
  13. CapStyleType,
  14. JoinStyleType,
  15. MarkEveryType,
  16. MarkerType,
  17. )
  18. from numpy.typing import ArrayLike
  19. def segment_hits(
  20. cx: ArrayLike, cy: ArrayLike, x: ArrayLike, y: ArrayLike, radius: ArrayLike
  21. ) -> ArrayLike: ...
  22. class Line2D(Artist):
  23. lineStyles: dict[str, str]
  24. drawStyles: dict[str, str]
  25. drawStyleKeys: list[str]
  26. markers: dict[str | int, str]
  27. filled_markers: tuple[str, ...]
  28. fillStyles: tuple[str, ...]
  29. zorder: float
  30. ind_offset: float
  31. def __init__(
  32. self,
  33. xdata: ArrayLike,
  34. ydata: ArrayLike,
  35. *,
  36. linewidth: float | None = ...,
  37. linestyle: LineStyleType | None = ...,
  38. color: ColorType | None = ...,
  39. gapcolor: ColorType | None = ...,
  40. marker: MarkerType | None = ...,
  41. markersize: float | None = ...,
  42. markeredgewidth: float | None = ...,
  43. markeredgecolor: ColorType | None = ...,
  44. markerfacecolor: ColorType | None = ...,
  45. markerfacecoloralt: ColorType = ...,
  46. fillstyle: FillStyleType | None = ...,
  47. antialiased: bool | None = ...,
  48. dash_capstyle: CapStyleType | None = ...,
  49. solid_capstyle: CapStyleType | None = ...,
  50. dash_joinstyle: JoinStyleType | None = ...,
  51. solid_joinstyle: JoinStyleType | None = ...,
  52. pickradius: float = ...,
  53. drawstyle: DrawStyleType | None = ...,
  54. markevery: MarkEveryType | None = ...,
  55. **kwargs
  56. ) -> None: ...
  57. def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict]: ...
  58. def get_pickradius(self) -> float: ...
  59. def set_pickradius(self, pickradius: float) -> None: ...
  60. pickradius: float
  61. def get_fillstyle(self) -> FillStyleType: ...
  62. stale: bool
  63. def set_fillstyle(self, fs: FillStyleType) -> None: ...
  64. def set_markevery(self, every: MarkEveryType) -> None: ...
  65. def get_markevery(self) -> MarkEveryType: ...
  66. def set_picker(
  67. self, p: None | bool | float | Callable[[Artist, MouseEvent], tuple[bool, dict]]
  68. ) -> None: ...
  69. def get_bbox(self) -> Bbox: ...
  70. @overload
  71. def set_data(self, args: ArrayLike) -> None: ...
  72. @overload
  73. def set_data(self, x: ArrayLike, y: ArrayLike) -> None: ...
  74. def recache_always(self) -> None: ...
  75. def recache(self, always: bool = ...) -> None: ...
  76. def get_antialiased(self) -> bool: ...
  77. def get_color(self) -> ColorType: ...
  78. def get_drawstyle(self) -> DrawStyleType: ...
  79. def get_gapcolor(self) -> ColorType: ...
  80. def get_linestyle(self) -> LineStyleType: ...
  81. def get_linewidth(self) -> float: ...
  82. def get_marker(self) -> MarkerType: ...
  83. def get_markeredgecolor(self) -> ColorType: ...
  84. def get_markeredgewidth(self) -> float: ...
  85. def get_markerfacecolor(self) -> ColorType: ...
  86. def get_markerfacecoloralt(self) -> ColorType: ...
  87. def get_markersize(self) -> float: ...
  88. def get_data(self, orig: bool = ...) -> tuple[ArrayLike, ArrayLike]: ...
  89. def get_xdata(self, orig: bool = ...) -> ArrayLike: ...
  90. def get_ydata(self, orig: bool = ...) -> ArrayLike: ...
  91. def get_path(self) -> Path: ...
  92. def get_xydata(self) -> ArrayLike: ...
  93. def set_antialiased(self, b: bool) -> None: ...
  94. def set_color(self, color: ColorType) -> None: ...
  95. def set_drawstyle(self, drawstyle: DrawStyleType | None) -> None: ...
  96. def set_gapcolor(self, gapcolor: ColorType | None) -> None: ...
  97. def set_linewidth(self, w: float) -> None: ...
  98. def set_linestyle(self, ls: LineStyleType) -> None: ...
  99. def set_marker(self, marker: MarkerType) -> None: ...
  100. def set_markeredgecolor(self, ec: ColorType | None) -> None: ...
  101. def set_markerfacecolor(self, fc: ColorType | None) -> None: ...
  102. def set_markerfacecoloralt(self, fc: ColorType | None) -> None: ...
  103. def set_markeredgewidth(self, ew: float | None) -> None: ...
  104. def set_markersize(self, sz: float) -> None: ...
  105. def set_xdata(self, x: ArrayLike) -> None: ...
  106. def set_ydata(self, y: ArrayLike) -> None: ...
  107. def set_dashes(self, seq: Sequence[float] | tuple[None, None]) -> None: ...
  108. def update_from(self, other: Artist) -> None: ...
  109. def set_dash_joinstyle(self, s: JoinStyleType) -> None: ...
  110. def set_solid_joinstyle(self, s: JoinStyleType) -> None: ...
  111. def get_dash_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
  112. def get_solid_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
  113. def set_dash_capstyle(self, s: CapStyleType) -> None: ...
  114. def set_solid_capstyle(self, s: CapStyleType) -> None: ...
  115. def get_dash_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
  116. def get_solid_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
  117. def is_dashed(self) -> bool: ...
  118. class AxLine(Line2D):
  119. def __init__(
  120. self,
  121. xy1: tuple[float, float],
  122. xy2: tuple[float, float] | None,
  123. slope: float | None,
  124. **kwargs
  125. ) -> None: ...
  126. def get_xy1(self) -> tuple[float, float] | None: ...
  127. def get_xy2(self) -> tuple[float, float] | None: ...
  128. def get_slope(self) -> float: ...
  129. def set_xy1(self, x: float, y: float) -> None: ...
  130. def set_xy2(self, x: float, y: float) -> None: ...
  131. def set_slope(self, slope: float) -> None: ...
  132. class VertexSelector:
  133. axes: Axes
  134. line: Line2D
  135. cid: int
  136. ind: set[int]
  137. def __init__(self, line: Line2D) -> None: ...
  138. @property
  139. def canvas(self) -> FigureCanvasBase: ...
  140. def process_selected(
  141. self, ind: Sequence[int], xs: ArrayLike, ys: ArrayLike
  142. ) -> None: ...
  143. def onpick(self, event: Any) -> None: ...
  144. lineStyles: dict[str, str]
  145. lineMarkers: dict[str | int, str]
  146. drawStyles: dict[str, str]
  147. fillStyles: tuple[FillStyleType, ...]