Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ea9591

Browse filesBrowse files
committed
[TYP] Change typing for texts to Any/object
1 parent dceb278 commit 1ea9591
Copy full SHA for 1ea9591

File tree

5 files changed

+8
-8
lines changed
Filter options

5 files changed

+8
-8
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ def text(self, x, y, s, fontdict=None, **kwargs):
641641
coordinates. The coordinate system can be changed using the
642642
*transform* parameter.
643643
644-
s : str
645-
The text.
644+
s : object
645+
The text. Will be converted to `str`, see `.Text.set_text`.
646646
647647
fontdict : dict, default: None
648648

‎lib/matplotlib/axes/_axes.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.pyi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Axes(_AxesBase):
112112
self,
113113
x: float,
114114
y: float,
115-
s: str,
115+
s: Any,
116116
fontdict: dict[str, Any] | None = ...,
117117
**kwargs
118118
) -> Text: ...

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3937,7 +3937,7 @@ def table(
39373937
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
39383938
@_copy_docstring_and_deprecators(Axes.text)
39393939
def text(
3940-
x: float, y: float, s: str, fontdict: dict[str, Any] | None = None, **kwargs
3940+
x: float, y: float, s: Any, fontdict: dict[str, Any] | None = None, **kwargs
39413941
) -> Text:
39423942
return gca().text(x, y, s, fontdict=fontdict, **kwargs)
39433943

‎lib/matplotlib/table.py

Copy file name to clipboardExpand all lines: lib/matplotlib/table.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def __init__(self, xy, width, height, *,
7676
The cell facecolor.
7777
fill : bool
7878
Whether the cell background is filled.
79-
text : str
80-
The cell text.
79+
text : object
80+
The cell text. Will be converted to `str`, see `.Text.set_text`.
8181
loc : {'left', 'center', 'right'}, default: 'right'
8282
The alignment of the text within the cell.
8383
fontproperties : dict

‎lib/matplotlib/table.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/table.pyi
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Cell(Rectangle):
2121
edgecolor: ColorType = ...,
2222
facecolor: ColorType = ...,
2323
fill: bool = ...,
24-
text: str = ...,
24+
text: Any = ...,
2525
loc: Literal["left", "center", "right"] | None = ...,
2626
fontproperties: dict[str, Any] | None = ...,
2727
visible_edges: str | None = ...
@@ -68,7 +68,7 @@ class Table(Artist):
6868

6969
def table(
7070
ax: Axes,
71-
cellText: Sequence[Sequence[str]] | None = ...,
71+
cellText: Sequence[Sequence[Any]] | None = ...,
7272
cellColours: Sequence[Sequence[ColorType]] | None = ...,
7373
cellLoc: Literal["left", "center", "right"] = ...,
7474
colWidths: Sequence[float] | None = ...,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.