()
| 148 | @image_comparison(['skew_rects.png'], remove_text=True, style='_classic_test', |
| 149 | tol=0 if platform.machine() == 'x86_64' else 0.009) |
| 150 | def test_skew_rectangle(): |
| 151 | |
| 152 | fix, axes = plt.subplots(5, 5, sharex=True, sharey=True, figsize=(8, 8)) |
| 153 | axes = axes.flat |
| 154 | |
| 155 | rotations = list(itertools.product([-3, -1, 0, 1, 3], repeat=2)) |
| 156 | |
| 157 | axes[0].set_xlim([-3, 3]) |
| 158 | axes[0].set_ylim([-3, 3]) |
| 159 | axes[0].set_aspect('equal', share=True) |
| 160 | |
| 161 | for ax, (xrots, yrots) in zip(axes, rotations): |
| 162 | xdeg, ydeg = 45 * xrots, 45 * yrots |
| 163 | t = transforms.Affine2D().skew_deg(xdeg, ydeg) |
| 164 | |
| 165 | ax.set_title(f'Skew of {xdeg} in X and {ydeg} in Y') |
| 166 | ax.add_patch(mpatch.Rectangle([-1, -1], 2, 2, |
| 167 | transform=t + ax.transData, |
| 168 | alpha=0.5, facecolor='coral')) |
| 169 | |
| 170 | plt.subplots_adjust(wspace=0, left=0.01, right=0.99, bottom=0.01, top=0.99) |
nothing calls this directly
no test coverage detected
searching dependent graphs…