| 161 | |
| 162 | |
| 163 | def test_streamplot_limits(): |
| 164 | ax = plt.axes() |
| 165 | x = np.linspace(-5, 10, 20) |
| 166 | y = np.linspace(-2, 4, 10) |
| 167 | y, x = np.meshgrid(y, x) |
| 168 | trans = mtransforms.Affine2D().translate(25, 32) + ax.transData |
| 169 | plt.barbs(x, y, np.sin(x), np.cos(y), transform=trans) |
| 170 | # The calculated bounds are approximately the bounds of the original data, |
| 171 | # this is because the entire path is taken into account when updating the |
| 172 | # datalim. |
| 173 | assert_array_almost_equal(ax.dataLim.bounds, (20, 30, 15, 6), |
| 174 | decimal=1) |
| 175 | |
| 176 | |
| 177 | def test_streamplot_grid(): |