Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 695bc25

Browse files
yaaunjklymaktimhoffm
authored
Expanded documentation of Axis.set_ticks as per discussion in issue #22262 (#22270)
* Expanded documentation of Axis.set_ticks() * Fix flake8 W293 (blank line contains whitespace) warnings * Expanded the documentation even more based on discussion in issue #22262 * Update lib/matplotlib/axis.py - @jklymak rewording Co-authored-by: Jody Klymak <[email protected]> * Reduced verbosity of doc by @jklymak 's suggestion. * On second thought, the previous wording could be seen as very ambiguous. * Update set_ticks docstring by @timhoffm compromise suggestion Co-authored-by: Tim Hoffmann <[email protected]> * Removed extra sentence as per @timhoffm review * Blank line whitespace issue crept up again * Update lib/matplotlib/axis.py as per correction by @timhoffm Co-authored-by: Tim Hoffmann <[email protected]> Co-authored-by: unknown <> Co-authored-by: Jody Klymak <[email protected]> Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 1791022 commit 695bc25

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,9 +1823,17 @@ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
18231823
Parameters
18241824
----------
18251825
ticks : list of floats
1826-
List of tick locations.
1826+
List of tick locations. The axis `.Locator` is replaced by a
1827+
`~.ticker.FixedLocator`.
1828+
1829+
Some tick formatters will not label arbitrary tick positions;
1830+
e.g. log formatters only label decade ticks by default. In
1831+
such a case you can set a formatter explicitly on the axis
1832+
using `.Axis.set_major_formatter` or provide formatted
1833+
*labels* yourself.
18271834
labels : list of str, optional
1828-
List of tick labels. If not set, the labels show the data value.
1835+
List of tick labels. If not set, the labels are generated with
1836+
the axis tick `.Formatter`.
18291837
minor : bool, default: False
18301838
If ``False``, set the major ticks; if ``True``, the minor ticks.
18311839
**kwargs

0 commit comments

Comments
 (0)