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

Skip to content

Commit d82e2d4

Browse files
authored
Merge pull request #19905 from hmeine/apply_kwargs_once
MNT: do not apply kwargs twice in to plt.yticklabels and plt.xticklabels
2 parents a61f208 + 8d23b8d commit d82e2d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,10 +1797,10 @@ def xticks(ticks=None, labels=None, **kwargs):
17971797

17981798
if labels is None:
17991799
labels = ax.get_xticklabels()
1800+
for l in labels:
1801+
l.update(kwargs)
18001802
else:
18011803
labels = ax.set_xticklabels(labels, **kwargs)
1802-
for l in labels:
1803-
l.update(kwargs)
18041804

18051805
return locs, labels
18061806

@@ -1857,10 +1857,10 @@ def yticks(ticks=None, labels=None, **kwargs):
18571857

18581858
if labels is None:
18591859
labels = ax.get_yticklabels()
1860+
for l in labels:
1861+
l.update(kwargs)
18601862
else:
18611863
labels = ax.set_yticklabels(labels, **kwargs)
1862-
for l in labels:
1863-
l.update(kwargs)
18641864

18651865
return locs, labels
18661866

0 commit comments

Comments
 (0)