()
| 8708 | |
| 8709 | |
| 8710 | def test_normal_axes(): |
| 8711 | with rc_context({'_internal.classic_mode': False}): |
| 8712 | fig, ax = plt.subplots(dpi=200, figsize=(6, 6)) |
| 8713 | fig.canvas.draw() |
| 8714 | plt.close(fig) |
| 8715 | bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax) |
| 8716 | |
| 8717 | # test the axis bboxes |
| 8718 | target = [ |
| 8719 | [124.0, 75.56, 982.0, 33.33], |
| 8720 | [86.89, 99.33, 52.0, 993.33], |
| 8721 | ] |
| 8722 | for nn, b in enumerate(bbaxis): |
| 8723 | targetbb = mtransforms.Bbox.from_bounds(*target[nn]) |
| 8724 | assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=1) |
| 8725 | |
| 8726 | target = [ |
| 8727 | [150.0, 119.999, 930.0, 11.111], |
| 8728 | [150.0, 1080.0, 930.0, 0.0], |
| 8729 | [150.0, 119.9999, 11.111, 960.0], |
| 8730 | [1068.8888, 119.9999, 11.111, 960.0] |
| 8731 | ] |
| 8732 | for nn, b in enumerate(bbspines): |
| 8733 | targetbb = mtransforms.Bbox.from_bounds(*target[nn]) |
| 8734 | assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2) |
| 8735 | |
| 8736 | target = [150.0, 119.99999999999997, 930.0, 960.0] |
| 8737 | targetbb = mtransforms.Bbox.from_bounds(*target) |
| 8738 | assert_array_almost_equal(bbax.bounds, targetbb.bounds, decimal=2) |
| 8739 | |
| 8740 | target = [86.89, 75.56, 1019.11, 1017.11] |
| 8741 | targetbb = mtransforms.Bbox.from_bounds(*target) |
| 8742 | assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=1) |
| 8743 | |
| 8744 | # test that get_position roundtrips to get_window_extent |
| 8745 | axbb = ax.get_position().transformed(fig.transFigure).bounds |
| 8746 | assert_array_almost_equal(axbb, ax.get_window_extent().bounds, decimal=2) |
| 8747 | |
| 8748 | |
| 8749 | def test_nodecorator(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…