()
| 215 | |
| 216 | |
| 217 | def test_invalid_log_lims(): |
| 218 | # Check that invalid log scale limits are ignored |
| 219 | fig, ax = plt.subplots() |
| 220 | ax.scatter(range(0, 4), range(0, 4)) |
| 221 | |
| 222 | ax.set_xscale('log') |
| 223 | original_xlim = ax.get_xlim() |
| 224 | with pytest.warns(UserWarning): |
| 225 | ax.set_xlim(left=0) |
| 226 | assert ax.get_xlim() == original_xlim |
| 227 | with pytest.warns(UserWarning): |
| 228 | ax.set_xlim(right=-1) |
| 229 | assert ax.get_xlim() == original_xlim |
| 230 | |
| 231 | ax.set_yscale('log') |
| 232 | original_ylim = ax.get_ylim() |
| 233 | with pytest.warns(UserWarning): |
| 234 | ax.set_ylim(bottom=0) |
| 235 | assert ax.get_ylim() == original_ylim |
| 236 | with pytest.warns(UserWarning): |
| 237 | ax.set_ylim(top=-1) |
| 238 | assert ax.get_ylim() == original_ylim |
| 239 | |
| 240 | |
| 241 | @image_comparison(['function_scales.png'], remove_text=True, style='mpl20') |
nothing calls this directly
no test coverage detected
searching dependent graphs…