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

Skip to content

Commit a9ebd40

Browse files
committed
small change for flask8 compliance. Adds entry to next_api_changes/behaviour.rst
1 parent afe6684 commit a9ebd40

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

doc/api/next_api_changes/behaviour.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ did nothing, when passed an unsupported value. It now raises a ``ValueError``.
4141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4242
``backend_pgf.LatexManager.latex`` is now created with ``encoding="utf-8"``, so
4343
its ``stdin``, ``stdout``, and ``stderr`` attributes are utf8-encoded.
44+
45+
``pyplot.xticks()`` and ``pyplot.yticks()``
46+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47+
Previously, passing labels without passing the ticks to either `.pyplot.xticks`
48+
and `.pyplot.yticks` would result in
49+
50+
TypeError: object of type 'NoneType' has no len()
51+
52+
It now raises a ``ValueError`` with a proper description of the error.

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,8 +1397,8 @@ def xticks(ticks=None, labels=None, **kwargs):
13971397
if ticks is None:
13981398
locs = ax.get_xticks()
13991399
if labels is not None:
1400-
raise TypeError("xticks(): Parameter 'labels' can't be set without "
1401-
"setting 'ticks'")
1400+
raise TypeError("xticks(): Parameter 'labels' can't be set "
1401+
"without setting 'ticks'")
14021402
else:
14031403
locs = ax.set_xticks(ticks)
14041404

@@ -1457,8 +1457,8 @@ def yticks(ticks=None, labels=None, **kwargs):
14571457
if ticks is None:
14581458
locs = ax.get_yticks()
14591459
if labels is not None:
1460-
raise TypeError("yticks(): Parameter 'labels' can't be set without "
1461-
"setting 'ticks'")
1460+
raise TypeError("yticks(): Parameter 'labels' can't be set "
1461+
"without setting 'ticks'")
14621462
else:
14631463
locs = ax.set_yticks(ticks)
14641464

0 commit comments

Comments
 (0)