()
| 12 | |
| 13 | |
| 14 | def test_axis_not_in_layout(): |
| 15 | fig1, (ax1_left, ax1_right) = plt.subplots(ncols=2, layout='constrained') |
| 16 | fig2, (ax2_left, ax2_right) = plt.subplots(ncols=2, layout='constrained') |
| 17 | |
| 18 | # 100 label overlapping the end of the axis |
| 19 | ax1_left.set_xlim(0, 100) |
| 20 | # 100 label not overlapping the end of the axis |
| 21 | ax2_left.set_xlim(0, 120) |
| 22 | |
| 23 | for ax in ax1_left, ax2_left: |
| 24 | ax.set_xticks([0, 100]) |
| 25 | ax.xaxis.set_in_layout(False) |
| 26 | |
| 27 | for fig in fig1, fig2: |
| 28 | fig.draw_without_rendering() |
| 29 | |
| 30 | # Positions should not be affected by overlapping 100 label |
| 31 | assert ax1_left.get_position().bounds == ax2_left.get_position().bounds |
| 32 | assert ax1_right.get_position().bounds == ax2_right.get_position().bounds |
| 33 | |
| 34 | |
| 35 | @check_figures_equal() |
nothing calls this directly
no test coverage detected
searching dependent graphs…