Skip to content

Commit 557375f

Browse files
committed
Don't misclip axis when calling set_ticks on inverted axes.
A small inversion in 0e41317...
1 parent 04d9d28 commit 557375f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/matplotlib/axis.py

Lines 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

Lines 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)