| 378 | |
| 379 | |
| 380 | def test_barb_limits(): |
| 381 | ax = plt.axes() |
| 382 | x = np.linspace(-5, 10, 20) |
| 383 | y = np.linspace(-2, 4, 10) |
| 384 | y, x = np.meshgrid(y, x) |
| 385 | trans = mtransforms.Affine2D().translate(25, 32) + ax.transData |
| 386 | plt.barbs(x, y, np.sin(x), np.cos(y), transform=trans) |
| 387 | # The calculated bounds are approximately the bounds of the original data, |
| 388 | # this is because the entire path is taken into account when updating the |
| 389 | # datalim. |
| 390 | assert_array_almost_equal(ax.dataLim.bounds, (20, 30, 15, 6), |
| 391 | decimal=1) |
| 392 | |
| 393 | |
| 394 | @image_comparison(['EllipseCollection_test_image.png'], remove_text=True, |