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 21a55d3

Browse filesBrowse files
authored
Merge pull request #14677 from anntzer/set_ticks-inverted
FIX: Don't misclip axis when calling set_ticks on inverted axes.
2 parents 0d486c2 + 557375f commit 21a55d3
Copy full SHA for 21a55d3

File tree

Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ def setter(self, vmin, vmax, ignore=False):
19061906
setter(self, min(vmin, vmax, oldmin), max(vmin, vmax, oldmax),
19071907
ignore=True)
19081908
else:
1909-
setter(self, max(vmin, vmax, oldmax), min(vmin, vmax, oldmin),
1909+
setter(self, max(vmin, vmax, oldmin), min(vmin, vmax, oldmax),
19101910
ignore=True)
19111911
self.stale = True
19121912

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6432,3 +6432,10 @@ def test_bar_errbar_zorder():
64326432
assert capline.zorder > bar.zorder
64336433
for barlinecol in barlinecols:
64346434
assert barlinecol.zorder > bar.zorder
6435+
6436+
6437+
def test_set_ticks_inverted():
6438+
fig, ax = plt.subplots()
6439+
ax.invert_xaxis()
6440+
ax.set_xticks([.3, .7])
6441+
assert ax.get_xlim() == (1, 0)

0 commit comments

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