()
| 361 | |
| 362 | |
| 363 | def test_quiver_limits(): |
| 364 | ax = plt.axes() |
| 365 | x, y = np.arange(8), np.arange(10) |
| 366 | u = v = np.linspace(0, 10, 80).reshape(10, 8) |
| 367 | q = plt.quiver(x, y, u, v) |
| 368 | assert q.get_datalim(ax.transData).bounds == (0., 0., 7., 9.) |
| 369 | |
| 370 | plt.figure() |
| 371 | ax = plt.axes() |
| 372 | x = np.linspace(-5, 10, 20) |
| 373 | y = np.linspace(-2, 4, 10) |
| 374 | y, x = np.meshgrid(y, x) |
| 375 | trans = mtransforms.Affine2D().translate(25, 32) + ax.transData |
| 376 | plt.quiver(x, y, np.sin(x), np.cos(y), transform=trans) |
| 377 | assert ax.dataLim.bounds == (20.0, 30.0, 15.0, 6.0) |
| 378 | |
| 379 | |
| 380 | def test_barb_limits(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…