Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 677e97d commit 625283fCopy full SHA for 625283f
1 file changed
lib/matplotlib/tests/test_scale.py
@@ -121,3 +121,21 @@ def test_logscale_nonpos_values():
121
122
ax4.set_yscale('log')
123
ax4.set_xscale('log')
124
+
125
126
+def test_invalid_log_lims():
127
+ # Check that invalid log scale limits are ignored
128
+ fig, ax = plt.subplots()
129
+ ax.scatter(range(0, 4), range(0, 4))
130
131
+ ax.set_xscale('log')
132
+ original_xlim = ax.get_xlim()
133
+ with pytest.warns(UserWarning):
134
+ ax.set_xlim(left=0)
135
+ assert ax.get_xlim() == original_xlim
136
137
+ ax.set_yscale('log')
138
+ original_ylim = ax.get_ylim()
139
140
+ ax.set_ylim(bottom=0)
141
+ assert ax.get_ylim() == original_ylim
0 commit comments