pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/e48eb530a183b54c92f55272a91462c6dabd3a26

origen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-9c8f61f9f58ad7b2.css" /> [DOC/TYP]: Allow any array like for set_[xy]ticks, not just list of f… · matplotlib/matplotlib@e48eb53 · GitHub
Skip to content

Commit e48eb53

Browse files
committed
[DOC/TYP]: Allow any array like for set_[xy]ticks, not just list of float
1 parent e7fd79f commit e48eb53

6 files changed

Lines changed: 12 additions & 9 deletions

File tree

lib/matplotlib/axes/_base.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class _AxesBase(martist.Artist):
399399
def get_xticks(self, *, minor: bool = ...) -> np.ndarray: ...
400400
def set_xticks(
401401
self,
402-
ticks: Iterable[float],
402+
ticks: ArrayLike,
403403
labels: Iterable[str] | None = ...,
404404
*,
405405
minor: bool = ...,
@@ -424,7 +424,7 @@ class _AxesBase(martist.Artist):
424424
def get_yticks(self, *, minor: bool = ...) -> np.ndarray: ...
425425
def set_yticks(
426426
self,
427-
ticks: Iterable[float],
427+
ticks: ArrayLike,
428428
labels: Iterable[str] | None = ...,
429429
*,
430430
minor: bool = ...,

lib/matplotlib/axes/_secondary_axes.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SecondaryAxis(_AxesBase):
2828
) -> None: ...
2929
def set_ticks(
3030
self,
31-
ticks: Iterable[float],
31+
ticks: ArrayLike,
3232
labels: Iterable[str] | None = ...,
3333
*,
3434
minor: bool = ...,

lib/matplotlib/axis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,10 +2009,12 @@ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
20092009
20102010
Parameters
20112011
----------
2012-
ticks : list of floats
2013-
List of tick locations. The axis `.Locator` is replaced by a
2012+
ticks : 1D ArrayLike
2013+
Array of tick locations. The axis `.Locator` is replaced by a
20142014
`~.ticker.FixedLocator`.
20152015
2016+
The values may be either floats or in axis units.
2017+
20162018
Some tick formatters will not label arbitrary tick positions;
20172019
e.g. log formatters only label decade ticks by default. In
20182020
such a case you can set a formatter explicitly on the axis

lib/matplotlib/axis.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class Axis(martist.Artist):
225225
) -> list[Text]: ...
226226
def set_ticks(
227227
self,
228-
ticks: Iterable[float],
228+
ticks: ArrayLike,
229229
labels: Iterable[str] | None = ...,
230230
*,
231231
minor: bool = ...,

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ class Colorbar:
260260
drawedges : bool
261261
Whether to draw lines at color boundaries.
262262
263+
263264
%(_colormap_kw_doc)s
264265
265266
location : None or {'left', 'right', 'top', 'bottom'}
@@ -863,7 +864,7 @@ def set_ticks(self, ticks, *, labels=None, minor=False, **kwargs):
863864
864865
Parameters
865866
----------
866-
ticks : list of floats
867+
ticks : 1D array-like
867868
List of tick locations.
868869
labels : list of str, optional
869870
List of tick labels. If not set, the labels show the data value.

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ def ylim(*args, **kwargs) -> tuple[float, float]:
18931893

18941894

18951895
def xticks(
1896-
ticks: Sequence[float] | None = None,
1896+
ticks: ArrayLike | None = None,
18971897
labels: Sequence[str] | None = None,
18981898
*,
18991899
minor: bool = False,
@@ -1963,7 +1963,7 @@ def xticks(
19631963

19641964

19651965
def yticks(
1966-
ticks: Sequence[float] | None = None,
1966+
ticks: ArrayLike | None = None,
19671967
labels: Sequence[str] | None = None,
19681968
*,
19691969
minor: bool = False,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy