()
| 116 | |
| 117 | |
| 118 | def test_label_without_ticks(): |
| 119 | fig, ax = plt.subplots() |
| 120 | plt.subplots_adjust(left=0.3, bottom=0.3) |
| 121 | ax.plot(np.arange(10)) |
| 122 | ax.yaxis.set_ticks_position('left') |
| 123 | ax.spines.left.set_position(('outward', 30)) |
| 124 | ax.spines.right.set_visible(False) |
| 125 | ax.set_ylabel('y label') |
| 126 | ax.xaxis.set_ticks_position('bottom') |
| 127 | ax.spines.bottom.set_position(('outward', 30)) |
| 128 | ax.spines.top.set_visible(False) |
| 129 | ax.set_xlabel('x label') |
| 130 | ax.xaxis.set_ticks([]) |
| 131 | ax.yaxis.set_ticks([]) |
| 132 | plt.draw() |
| 133 | |
| 134 | spine = ax.spines.left |
| 135 | spinebbox = spine.get_transform().transform_path( |
| 136 | spine.get_path()).get_extents() |
| 137 | assert ax.yaxis.label.get_position()[0] < spinebbox.xmin, \ |
| 138 | "Y-Axis label not left of the spine" |
| 139 | |
| 140 | spine = ax.spines.bottom |
| 141 | spinebbox = spine.get_transform().transform_path( |
| 142 | spine.get_path()).get_extents() |
| 143 | assert ax.xaxis.label.get_position()[1] < spinebbox.ymin, \ |
| 144 | "X-Axis label not below the spine" |
| 145 | |
| 146 | |
| 147 | @image_comparison(['black_axes.png'], style='_classic_test') |
nothing calls this directly
no test coverage detected
searching dependent graphs…