| 4626 | |
| 4627 | |
| 4628 | def test_errorbar_shape(): |
| 4629 | fig = plt.figure() |
| 4630 | ax = fig.gca() |
| 4631 | |
| 4632 | x = np.arange(0.1, 4, 0.5) |
| 4633 | y = np.exp(-x) |
| 4634 | yerr1 = 0.1 + 0.2*np.sqrt(x) |
| 4635 | yerr = np.vstack((yerr1, 2*yerr1)).T |
| 4636 | xerr = 0.1 + yerr |
| 4637 | |
| 4638 | with pytest.raises(ValueError): |
| 4639 | ax.errorbar(x, y, yerr=yerr, fmt='o') |
| 4640 | with pytest.raises(ValueError): |
| 4641 | ax.errorbar(x, y, xerr=xerr, fmt='o') |
| 4642 | with pytest.raises(ValueError): |
| 4643 | ax.errorbar(x, y, yerr=yerr, xerr=xerr, fmt='o') |
| 4644 | |
| 4645 | |
| 4646 | @image_comparison(['errorbar_limits.png'], style='mpl20') |