()
| 383 | |
| 384 | |
| 385 | def test_clipped_to_axes(): |
| 386 | # Ensure that _fully_clipped_to_axes() returns True under default |
| 387 | # conditions for all projection types. Axes.get_tightbbox() |
| 388 | # uses this to skip artists in layout calculations. |
| 389 | arr = np.arange(100).reshape((10, 10)) |
| 390 | fig = plt.figure(figsize=(6, 2)) |
| 391 | ax1 = fig.add_subplot(131, projection='rectilinear') |
| 392 | ax2 = fig.add_subplot(132, projection='mollweide') |
| 393 | ax3 = fig.add_subplot(133, projection='polar') |
| 394 | for ax in (ax1, ax2, ax3): |
| 395 | # Default conditions (clipped by ax.bbox or ax.patch) |
| 396 | ax.grid(False) |
| 397 | h, = ax.plot(arr[:, 0]) |
| 398 | m = ax.pcolor(arr) |
| 399 | assert h._fully_clipped_to_axes() |
| 400 | assert m._fully_clipped_to_axes() |
| 401 | # Non-default conditions (not clipped by ax.patch) |
| 402 | rect = Rectangle((0, 0), 0.5, 0.5, transform=ax.transAxes) |
| 403 | h.set_clip_path(rect) |
| 404 | m.set_clip_path(rect.get_path(), rect.get_transform()) |
| 405 | assert not h._fully_clipped_to_axes() |
| 406 | assert not m._fully_clipped_to_axes() |
| 407 | |
| 408 | |
| 409 | def test_tight_pads(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…