| 444 | @image_comparison(['twin_autoscale.png'], style='_classic_test', |
| 445 | tol=0 if platform.machine() == 'x86_64' else 0.009) |
| 446 | def test_twinx_axis_scales(): |
| 447 | x = np.array([0, 0.5, 1]) |
| 448 | y = 0.5 * x |
| 449 | x2 = np.array([0, 1, 2]) |
| 450 | y2 = 2 * x2 |
| 451 | |
| 452 | fig = plt.figure() |
| 453 | ax = fig.add_axes((0, 0, 1, 1), autoscalex_on=False, autoscaley_on=False) |
| 454 | ax.plot(x, y, color='blue', lw=10) |
| 455 | |
| 456 | ax2 = plt.twinx(ax) |
| 457 | ax2.plot(x2, y2, 'r--', lw=5) |
| 458 | |
| 459 | ax.margins(0, 0) |
| 460 | ax2.margins(0, 0) |
| 461 | |
| 462 | |
| 463 | def test_twin_inherit_autoscale_setting(): |